From 086c6e96ca4b98e8a144b5f7f37a7b3b6fedc61d Mon Sep 17 00:00:00 2001 From: Christopher Peplin Date: Sat, 20 Sep 2014 16:14:32 -0400 Subject: Move tests back to 'examples', skip non-testable examples when testing. This fixes https://github.com/sudar/Arduino-Makefile/issues/259. --- script/runtests.sh | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'script/runtests.sh') 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` -- cgit v1.2.3 From 663626f06d79aa4d3d3b17e0391897c852658a28 Mon Sep 17 00:00:00 2001 From: Christopher Peplin Date: Sat, 20 Sep 2014 16:26:08 -0400 Subject: Move scripts inside tests directory. Fixed https://github.com/sudar/Arduino-Makefile/issues/260 --- script/runtests.sh | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) delete mode 100755 script/runtests.sh (limited to 'script/runtests.sh') diff --git a/script/runtests.sh b/script/runtests.sh deleted file mode 100755 index 5f513da..0000000 --- a/script/runtests.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env bash - -TESTS_DIR=examples - -failures=() - -# 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` - make_output=`make` - if [[ $? -ne 0 ]]; then - failures+=("$example") - echo "Example $example failed" - fi - popd -done - -for failure in "${failures[@]}"; do - echo "Example $failure failed" -done - -if [[ ${#failures[@]} -eq 0 ]]; then - echo "All tests passed." -else - exit 1 -fi -- cgit v1.2.3