From ea433b8168169c151c12b2071169a7fa96ad3fde Mon Sep 17 00:00:00 2001 From: Hanna Hermsen Date: Mon, 27 Oct 2014 21:15:54 +0100 Subject: [PATCH] Added serial support for the Arduino Leonardo/Micro. Updates the readme accordingly. --- readme.md | 6 ++++++ src/examples/advanced/advanced.ino | 1 + src/examples/basic/basic.ino | 1 + src/examples/continuous/continuous.ino | 1 + src/examples/digital_pin_test/digital_pin_test.ino | 1 + src/examples/filter/filter.ino | 3 ++- src/examples/verbosity/verbosity.ino | 1 + 7 files changed, 13 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index fe87d1d..f244a77 100644 --- a/readme.md +++ b/readme.md @@ -71,6 +71,7 @@ test(bad) void setup() { Serial.begin(9600); + while(!Serial); // for the Arduino Leonardo/Micro only } void loop() @@ -330,6 +331,7 @@ A single test `my_test` void setup() { Serial.begin(9600); + while(!Serial); // for the Arduino Leonardo/Micro only Test::exclude("*"); Test::include("my_test"); } @@ -340,6 +342,7 @@ All tests named dev_-something, but not the ones ending in _skip or _slow, or ha void setup() { Serial.begin(9600); + while(!Serial); // for the Arduino Leonardo/Micro only Test::exclude("*"); Test::include("dev_*"); Test::exclude("*_slow"); @@ -380,6 +383,9 @@ A. Here is a troubleshooting guideline: * Make sure you call `Serial.begin()` in your setup. Or, if you redirect output by changing the value of `Test::out`, make sure you configure the Print stream you direct it to. + * If you are using an Arduino Leonardo/Micro: don't forget to add + `while(!Serial)` after `Serial.begin(9600)` in the setup(). Without this line + nothing will be printed in the serial monitor. * Make sure you call `Test::run()` in your loop(). * Make sure you did not exclude the test(s) with `Test::exclude(pattern)`. By default all tests are included. diff --git a/src/examples/advanced/advanced.ino b/src/examples/advanced/advanced.ino index e306d6a..027ebd3 100644 --- a/src/examples/advanced/advanced.ino +++ b/src/examples/advanced/advanced.ino @@ -75,6 +75,7 @@ MyTest myTest3("myTest3"); void setup() { Serial.begin(9600); + while(!Serial); // for the Arduino Leonardo/Micro only Test::min_verbosity |= TEST_VERBOSITY_ASSERTIONS_ALL; Test::exclude("my*2"); diff --git a/src/examples/basic/basic.ino b/src/examples/basic/basic.ino index 5ad761d..b199305 100644 --- a/src/examples/basic/basic.ino +++ b/src/examples/basic/basic.ino @@ -16,6 +16,7 @@ test(incorrect) void setup() { Serial.begin(9600); + while(!Serial); // for the Arduino Leonardo/Micro only } void loop() diff --git a/src/examples/continuous/continuous.ino b/src/examples/continuous/continuous.ino index 0aeee98..a76a0e5 100644 --- a/src/examples/continuous/continuous.ino +++ b/src/examples/continuous/continuous.ino @@ -19,6 +19,7 @@ testing(continuous) void setup() { Serial.begin(9600); + while(!Serial); // for the Arduino Leonardo/Micro only } void loop() diff --git a/src/examples/digital_pin_test/digital_pin_test.ino b/src/examples/digital_pin_test/digital_pin_test.ino index 88c3463..6837465 100644 --- a/src/examples/digital_pin_test/digital_pin_test.ino +++ b/src/examples/digital_pin_test/digital_pin_test.ino @@ -42,6 +42,7 @@ THE SOFTWARE. void setup() { Serial.begin(9600); + while(!Serial); // for the Arduino Leonardo/Micro only } /** diff --git a/src/examples/filter/filter.ino b/src/examples/filter/filter.ino index f227cf6..6d7a4c6 100644 --- a/src/examples/filter/filter.ino +++ b/src/examples/filter/filter.ino @@ -12,7 +12,8 @@ test(crypto_sha256) { pass(); } void setup() { Serial.begin(9600); - + while(!Serial); // for the Arduino Leonardo/Micro only + // all tests named net_ - something, except net_ftp Test::exclude("*"); Test::include("net_*"); diff --git a/src/examples/verbosity/verbosity.ino b/src/examples/verbosity/verbosity.ino index db5b28e..456cc32 100644 --- a/src/examples/verbosity/verbosity.ino +++ b/src/examples/verbosity/verbosity.ino @@ -44,6 +44,7 @@ test(quiet_skip) void setup() { Serial.begin(9600); + while(!Serial); // for the Arduino Leonardo/Micro only } void loop()