I am trying to run a demo unit test on the teensy 4.1. The unit test stalls after upload with the following message:
Processing * in teensy41 environment
---------------------------------------------------------------
Building...
Uploading...
Testing...
If you don't see any output for the first 10 secs, please reset board (press reset button)
The platformio.ini file is configured as:
[env:teensy41]
platform = teensy
board = teensy41
framework = arduino
upload_protocol = teensy-cli
The test file is taken from one of the unit test demos, not doing anything fancy:
#include <Arduino.h>
#include <unity.h>
void test_led_builtin_pin_number(void) {
TEST_ASSERT_EQUAL(13, LED_BUILTIN);
}
void test_led_state_high(void) {
digitalWrite(LED_BUILTIN, HIGH);
TEST_ASSERT_EQUAL(HIGH, digitalRead(LED_BUILTIN));
}
void test_led_state_low(void) {
digitalWrite(LED_BUILTIN, LOW);
TEST_ASSERT_EQUAL(LOW, digitalRead(LED_BUILTIN));
}
void setup() {
// NOTE!!! Wait for >2 secs
// if board doesn't support software reset via Serial.DTR/RTS
delay(3000);
UNITY_BEGIN(); // IMPORTANT LINE!
RUN_TEST(test_led_builtin_pin_number);
pinMode(LED_BUILTIN, OUTPUT);
}
uint8_t i = 0;
uint8_t max_blinks = 5;
void loop() {
if (i < max_blinks)
{
RUN_TEST(test_led_state_high);
delay(500);
RUN_TEST(test_led_state_low);
delay(500);
i++;
}
else if (i >= max_blinks) {
UNITY_END(); // stop unit testing
}
}
The program successfully uploads, and the board blinks N times as expected but does not print out any test results. If I open the serial monitor while the program is running I can see testing outputs flash repeatedly:
-----------------------
11 Tests 0 Failures 0 Ignored
OK
Any suggestions? I have tried on both a Windows and Linux machine with the same results. Ran the same tests on the esp32 with success.
pio core version is 5.2.0a6
teensy version is 4.12.0