From 086c6e96ca4b98e8a144b5f7f37a7b3b6fedc61d Mon Sep 17 00:00:00 2001 From: Christopher Peplin Date: Sat, 20 Sep 2014 16:14:32 -0400 Subject: [PATCH] Move tests back to 'examples', skip non-testable examples when testing. This fixes https://github.com/sudar/Arduino-Makefile/issues/259. --- .../AnalogInOutSerial/AnalogInOutSerial.ino | 0 .../AnalogInOutSerial/Makefile | 0 {tests => examples}/Blink/Blink.ino | 0 {tests => examples}/Blink/Makefile | 0 .../BlinkChipKIT/BlinkChipKIT.pde | 0 {tests => examples}/BlinkChipKIT/Makefile | 0 {tests => examples}/BlinkInAVRC/Makefile | 0 {tests => examples}/BlinkInAVRC/blink.c | 0 .../BlinkWithoutDelay/BlinkWithoutDelay.ino | 0 .../BlinkWithoutDelay/Makefile | 0 {tests => examples}/Fade/Fade.ino | 0 {tests => examples}/Fade/Makefile | 0 {tests => examples}/HelloWorld/HelloWorld.ino | 0 {tests => examples}/HelloWorld/Makefile | 0 {tests => examples}/TestSuiteCommon.mk | 0 {tests => examples}/WebServer/Makefile | 0 {tests => examples}/WebServer/WebServer.ino | 0 {tests => examples}/master_reader/Makefile | 0 .../master_reader/master_reader.ino | 0 {tests => examples}/toneMelody/Makefile | 0 {tests => examples}/toneMelody/pitches.h | 0 {tests => examples}/toneMelody/toneMelody.ino | 0 script/runtests.sh | 22 ++++++++++++++++++- 23 files changed, 21 insertions(+), 1 deletion(-) rename {tests => examples}/AnalogInOutSerial/AnalogInOutSerial.ino (100%) rename {tests => examples}/AnalogInOutSerial/Makefile (100%) rename {tests => examples}/Blink/Blink.ino (100%) rename {tests => examples}/Blink/Makefile (100%) rename {tests => examples}/BlinkChipKIT/BlinkChipKIT.pde (100%) rename {tests => examples}/BlinkChipKIT/Makefile (100%) rename {tests => examples}/BlinkInAVRC/Makefile (100%) rename {tests => examples}/BlinkInAVRC/blink.c (100%) rename {tests => examples}/BlinkWithoutDelay/BlinkWithoutDelay.ino (100%) rename {tests => examples}/BlinkWithoutDelay/Makefile (100%) rename {tests => examples}/Fade/Fade.ino (100%) rename {tests => examples}/Fade/Makefile (100%) rename {tests => examples}/HelloWorld/HelloWorld.ino (100%) rename {tests => examples}/HelloWorld/Makefile (100%) rename {tests => examples}/TestSuiteCommon.mk (100%) rename {tests => examples}/WebServer/Makefile (100%) rename {tests => examples}/WebServer/WebServer.ino (100%) rename {tests => examples}/master_reader/Makefile (100%) rename {tests => examples}/master_reader/master_reader.ino (100%) rename {tests => examples}/toneMelody/Makefile (100%) rename {tests => examples}/toneMelody/pitches.h (100%) rename {tests => examples}/toneMelody/toneMelody.ino (100%) diff --git a/tests/AnalogInOutSerial/AnalogInOutSerial.ino b/examples/AnalogInOutSerial/AnalogInOutSerial.ino similarity index 100% rename from tests/AnalogInOutSerial/AnalogInOutSerial.ino rename to examples/AnalogInOutSerial/AnalogInOutSerial.ino diff --git a/tests/AnalogInOutSerial/Makefile b/examples/AnalogInOutSerial/Makefile similarity index 100% rename from tests/AnalogInOutSerial/Makefile rename to examples/AnalogInOutSerial/Makefile diff --git a/tests/Blink/Blink.ino b/examples/Blink/Blink.ino similarity index 100% rename from tests/Blink/Blink.ino rename to examples/Blink/Blink.ino diff --git a/tests/Blink/Makefile b/examples/Blink/Makefile similarity index 100% rename from tests/Blink/Makefile rename to examples/Blink/Makefile diff --git a/tests/BlinkChipKIT/BlinkChipKIT.pde b/examples/BlinkChipKIT/BlinkChipKIT.pde similarity index 100% rename from tests/BlinkChipKIT/BlinkChipKIT.pde rename to examples/BlinkChipKIT/BlinkChipKIT.pde diff --git a/tests/BlinkChipKIT/Makefile b/examples/BlinkChipKIT/Makefile similarity index 100% rename from tests/BlinkChipKIT/Makefile rename to examples/BlinkChipKIT/Makefile diff --git a/tests/BlinkInAVRC/Makefile b/examples/BlinkInAVRC/Makefile similarity index 100% rename from tests/BlinkInAVRC/Makefile rename to examples/BlinkInAVRC/Makefile diff --git a/tests/BlinkInAVRC/blink.c b/examples/BlinkInAVRC/blink.c similarity index 100% rename from tests/BlinkInAVRC/blink.c rename to examples/BlinkInAVRC/blink.c diff --git a/tests/BlinkWithoutDelay/BlinkWithoutDelay.ino b/examples/BlinkWithoutDelay/BlinkWithoutDelay.ino similarity index 100% rename from tests/BlinkWithoutDelay/BlinkWithoutDelay.ino rename to examples/BlinkWithoutDelay/BlinkWithoutDelay.ino diff --git a/tests/BlinkWithoutDelay/Makefile b/examples/BlinkWithoutDelay/Makefile similarity index 100% rename from tests/BlinkWithoutDelay/Makefile rename to examples/BlinkWithoutDelay/Makefile diff --git a/tests/Fade/Fade.ino b/examples/Fade/Fade.ino similarity index 100% rename from tests/Fade/Fade.ino rename to examples/Fade/Fade.ino diff --git a/tests/Fade/Makefile b/examples/Fade/Makefile similarity index 100% rename from tests/Fade/Makefile rename to examples/Fade/Makefile diff --git a/tests/HelloWorld/HelloWorld.ino b/examples/HelloWorld/HelloWorld.ino similarity index 100% rename from tests/HelloWorld/HelloWorld.ino rename to examples/HelloWorld/HelloWorld.ino diff --git a/tests/HelloWorld/Makefile b/examples/HelloWorld/Makefile similarity index 100% rename from tests/HelloWorld/Makefile rename to examples/HelloWorld/Makefile diff --git a/tests/TestSuiteCommon.mk b/examples/TestSuiteCommon.mk similarity index 100% rename from tests/TestSuiteCommon.mk rename to examples/TestSuiteCommon.mk diff --git a/tests/WebServer/Makefile b/examples/WebServer/Makefile similarity index 100% rename from tests/WebServer/Makefile rename to examples/WebServer/Makefile diff --git a/tests/WebServer/WebServer.ino b/examples/WebServer/WebServer.ino similarity index 100% rename from tests/WebServer/WebServer.ino rename to examples/WebServer/WebServer.ino diff --git a/tests/master_reader/Makefile b/examples/master_reader/Makefile similarity index 100% rename from tests/master_reader/Makefile rename to examples/master_reader/Makefile diff --git a/tests/master_reader/master_reader.ino b/examples/master_reader/master_reader.ino similarity index 100% rename from tests/master_reader/master_reader.ino rename to examples/master_reader/master_reader.ino diff --git a/tests/toneMelody/Makefile b/examples/toneMelody/Makefile similarity index 100% rename from tests/toneMelody/Makefile rename to examples/toneMelody/Makefile diff --git a/tests/toneMelody/pitches.h b/examples/toneMelody/pitches.h similarity index 100% rename from tests/toneMelody/pitches.h rename to examples/toneMelody/pitches.h diff --git a/tests/toneMelody/toneMelody.ino b/examples/toneMelody/toneMelody.ino similarity index 100% rename from tests/toneMelody/toneMelody.ino rename to examples/toneMelody/toneMelody.ino diff --git a/script/runtests.sh b/script/runtests.sh index ad42f74..5f513da 100755 --- a/script/runtests.sh +++ b/script/runtests.sh @@ -1,11 +1,31 @@ #!/usr/bin/env bash +TESTS_DIR=examples + failures=() -for dir in tests/*/ +# These examples cannot be tested easily at the moment as they require +# alternate cores. The MakefileExample doesn't actually contain any source code +# to compile. +NON_TESTABLE_EXAMPLES=(ATtinyBlink MakefileExample TinySoftWareSerial) + +for dir in $TESTS_DIR/*/ do dir=${dir%*/} example=${dir##*/} + example_is_testable=true + for non_testable_example in "${NON_TESTABLE_EXAMPLES[@]}"; do + if [[ $example == $non_testable_example ]]; then + example_is_testable=false + break + fi + done + + if ! $example_is_testable; then + echo "Skipping non-testable example $example..." + continue + fi + pushd $dir echo "Compiling $example..." make_output=`make clean`