aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSudar <sudar@sudarmuthu.com>2014-09-21 12:05:12 +0530
committerSudar <sudar@sudarmuthu.com>2014-09-21 12:05:12 +0530
commitee1855c6b1aabf4d50afcfba69cecd2417d27237 (patch)
tree05db0503f3cb1ffbd41f077ecf6135a429d5b66b
parent6f46722abb40c60dcaa0e40292342d015906c8bf (diff)
parentd092c14d7ec845246f6588704e22718615626982 (diff)
Merge pull request #268 from peplin/259-move-examples
Move tests back to 'examples', skip non-testable examples when testing. Fix #259 Fix #260
-rw-r--r--.gitignore1
-rw-r--r--.travis.yml4
-rw-r--r--README.md9
-rw-r--r--examples/AnalogInOutSerial/AnalogInOutSerial.ino (renamed from tests/AnalogInOutSerial/AnalogInOutSerial.ino)0
-rw-r--r--examples/AnalogInOutSerial/Makefile (renamed from tests/AnalogInOutSerial/Makefile)0
-rw-r--r--examples/Blink/Blink.ino (renamed from tests/Blink/Blink.ino)0
-rw-r--r--examples/Blink/Makefile (renamed from tests/Blink/Makefile)0
-rw-r--r--examples/BlinkChipKIT/BlinkChipKIT.pde (renamed from tests/BlinkChipKIT/BlinkChipKIT.pde)0
-rw-r--r--examples/BlinkChipKIT/Makefile (renamed from tests/BlinkChipKIT/Makefile)0
-rw-r--r--examples/BlinkInAVRC/Makefile (renamed from tests/BlinkInAVRC/Makefile)0
-rw-r--r--examples/BlinkInAVRC/blink.c (renamed from tests/BlinkInAVRC/blink.c)0
-rw-r--r--examples/BlinkWithoutDelay/BlinkWithoutDelay.ino (renamed from tests/BlinkWithoutDelay/BlinkWithoutDelay.ino)0
-rw-r--r--examples/BlinkWithoutDelay/Makefile (renamed from tests/BlinkWithoutDelay/Makefile)0
-rw-r--r--examples/Fade/Fade.ino (renamed from tests/Fade/Fade.ino)0
-rw-r--r--examples/Fade/Makefile (renamed from tests/Fade/Makefile)0
-rw-r--r--examples/HelloWorld/HelloWorld.ino (renamed from tests/HelloWorld/HelloWorld.ino)0
-rw-r--r--examples/HelloWorld/Makefile (renamed from tests/HelloWorld/Makefile)0
-rw-r--r--examples/TestSuiteCommon.mk (renamed from tests/TestSuiteCommon.mk)2
-rw-r--r--examples/WebServer/Makefile (renamed from tests/WebServer/Makefile)0
-rw-r--r--examples/WebServer/WebServer.ino (renamed from tests/WebServer/WebServer.ino)0
-rw-r--r--examples/master_reader/Makefile (renamed from tests/master_reader/Makefile)0
-rw-r--r--examples/master_reader/master_reader.ino (renamed from tests/master_reader/master_reader.ino)0
-rw-r--r--examples/toneMelody/Makefile (renamed from tests/toneMelody/Makefile)0
-rw-r--r--examples/toneMelody/pitches.h (renamed from tests/toneMelody/pitches.h)0
-rw-r--r--examples/toneMelody/toneMelody.ino (renamed from tests/toneMelody/toneMelody.ino)0
-rwxr-xr-xscript/runtests.sh28
-rwxr-xr-xtests/script/bootstrap.sh (renamed from script/bootstrap.sh)0
-rw-r--r--tests/script/bootstrap/arduino.sh (renamed from script/bootstrap/arduino.sh)0
-rw-r--r--tests/script/bootstrap/chipkit.sh (renamed from script/bootstrap/chipkit.sh)0
-rw-r--r--tests/script/bootstrap/common.sh (renamed from script/bootstrap/common.sh)2
-rw-r--r--tests/script/bootstrap/pip-requirements.txt (renamed from script/bootstrap/pip-requirements.txt)0
-rwxr-xr-xtests/script/runtests.sh48
32 files changed, 58 insertions, 36 deletions
diff --git a/.gitignore b/.gitignore
index a0d6d59..2fa5764 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,4 @@
*.o
build-cli
/.project
-/dependencies
build-*
diff --git a/.travis.yml b/.travis.yml
index 68efeb5..f97a4ea 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,5 +1,5 @@
language: c
compiler:
- gcc
-script: script/runtests.sh
-before_install: script/bootstrap.sh
+script: tests/script/runtests.sh
+before_install: tests/script/bootstrap.sh
diff --git a/README.md b/README.md
index b929f6c..a5f1cff 100644
--- a/README.md
+++ b/README.md
@@ -215,9 +215,12 @@ Then, the following line must be added to the project Makefile :
## Test Suite
This project includes a suite of example Makefiles and small Arduino and chipKIT
-programs to assist the developers. Run `script/bootstrap.sh` to attempt to
-automatically install the dependencies (Arduino IDE, MPIDE, etc.). Run
-`script/runtests.sh` to attempt to compile all of the examples.
+programs to assist the maintainers of the Makefile. Run
+`tests/script/bootstrap.sh` to attempt to automatically install the dependencies
+(Arduino IDE, MPIDE, etc.). Run `tests/script/runtests.sh` to attempt to compile
+all of the examples. The bootstrap script is primarily intended for use by a
+continuous integration server, specifically Travis CI. It is not intended for
+normal users.
### Bare-Arduino–Project
diff --git a/tests/AnalogInOutSerial/AnalogInOutSerial.ino b/examples/AnalogInOutSerial/AnalogInOutSerial.ino
index e142f69..e142f69 100644
--- a/tests/AnalogInOutSerial/AnalogInOutSerial.ino
+++ b/examples/AnalogInOutSerial/AnalogInOutSerial.ino
diff --git a/tests/AnalogInOutSerial/Makefile b/examples/AnalogInOutSerial/Makefile
index 872d069..872d069 100644
--- a/tests/AnalogInOutSerial/Makefile
+++ b/examples/AnalogInOutSerial/Makefile
diff --git a/tests/Blink/Blink.ino b/examples/Blink/Blink.ino
index 1953c39..1953c39 100644
--- a/tests/Blink/Blink.ino
+++ b/examples/Blink/Blink.ino
diff --git a/tests/Blink/Makefile b/examples/Blink/Makefile
index d41effa..d41effa 100644
--- a/tests/Blink/Makefile
+++ b/examples/Blink/Makefile
diff --git a/tests/BlinkChipKIT/BlinkChipKIT.pde b/examples/BlinkChipKIT/BlinkChipKIT.pde
index 1953c39..1953c39 100644
--- a/tests/BlinkChipKIT/BlinkChipKIT.pde
+++ b/examples/BlinkChipKIT/BlinkChipKIT.pde
diff --git a/tests/BlinkChipKIT/Makefile b/examples/BlinkChipKIT/Makefile
index bec2794..bec2794 100644
--- a/tests/BlinkChipKIT/Makefile
+++ b/examples/BlinkChipKIT/Makefile
diff --git a/tests/BlinkInAVRC/Makefile b/examples/BlinkInAVRC/Makefile
index 9080b24..9080b24 100644
--- a/tests/BlinkInAVRC/Makefile
+++ b/examples/BlinkInAVRC/Makefile
diff --git a/tests/BlinkInAVRC/blink.c b/examples/BlinkInAVRC/blink.c
index d8b7c8f..d8b7c8f 100644
--- a/tests/BlinkInAVRC/blink.c
+++ b/examples/BlinkInAVRC/blink.c
diff --git a/tests/BlinkWithoutDelay/BlinkWithoutDelay.ino b/examples/BlinkWithoutDelay/BlinkWithoutDelay.ino
index 0143571..0143571 100644
--- a/tests/BlinkWithoutDelay/BlinkWithoutDelay.ino
+++ b/examples/BlinkWithoutDelay/BlinkWithoutDelay.ino
diff --git a/tests/BlinkWithoutDelay/Makefile b/examples/BlinkWithoutDelay/Makefile
index 872d069..872d069 100644
--- a/tests/BlinkWithoutDelay/Makefile
+++ b/examples/BlinkWithoutDelay/Makefile
diff --git a/tests/Fade/Fade.ino b/examples/Fade/Fade.ino
index b47bf43..b47bf43 100644
--- a/tests/Fade/Fade.ino
+++ b/examples/Fade/Fade.ino
diff --git a/tests/Fade/Makefile b/examples/Fade/Makefile
index 872d069..872d069 100644
--- a/tests/Fade/Makefile
+++ b/examples/Fade/Makefile
diff --git a/tests/HelloWorld/HelloWorld.ino b/examples/HelloWorld/HelloWorld.ino
index e99957d..e99957d 100644
--- a/tests/HelloWorld/HelloWorld.ino
+++ b/examples/HelloWorld/HelloWorld.ino
diff --git a/tests/HelloWorld/Makefile b/examples/HelloWorld/Makefile
index 0af2ed4..0af2ed4 100644
--- a/tests/HelloWorld/Makefile
+++ b/examples/HelloWorld/Makefile
diff --git a/tests/TestSuiteCommon.mk b/examples/TestSuiteCommon.mk
index 5fa4f50..a66a007 100644
--- a/tests/TestSuiteCommon.mk
+++ b/examples/TestSuiteCommon.mk
@@ -1,5 +1,5 @@
ARDMK_DIR=../../
-DEPENDENCIES_FOLDER = ../../dependencies
+DEPENDENCIES_FOLDER = /var/tmp/Arduino-Makefile-testing-dependencies
DEPENDENCIES_MPIDE_DIR = $(DEPENDENCIES_FOLDER)/mpide-0023-linux64-20130817-test
ifeq ($(MPIDE_DIR),)
diff --git a/tests/WebServer/Makefile b/examples/WebServer/Makefile
index 5fbefae..5fbefae 100644
--- a/tests/WebServer/Makefile
+++ b/examples/WebServer/Makefile
diff --git a/tests/WebServer/WebServer.ino b/examples/WebServer/WebServer.ino
index fb2a1b9..fb2a1b9 100644
--- a/tests/WebServer/WebServer.ino
+++ b/examples/WebServer/WebServer.ino
diff --git a/tests/master_reader/Makefile b/examples/master_reader/Makefile
index 8a42a8e..8a42a8e 100644
--- a/tests/master_reader/Makefile
+++ b/examples/master_reader/Makefile
diff --git a/tests/master_reader/master_reader.ino b/examples/master_reader/master_reader.ino
index 4124d7d..4124d7d 100644
--- a/tests/master_reader/master_reader.ino
+++ b/examples/master_reader/master_reader.ino
diff --git a/tests/toneMelody/Makefile b/examples/toneMelody/Makefile
index 872d069..872d069 100644
--- a/tests/toneMelody/Makefile
+++ b/examples/toneMelody/Makefile
diff --git a/tests/toneMelody/pitches.h b/examples/toneMelody/pitches.h
index 55c7d54..55c7d54 100644
--- a/tests/toneMelody/pitches.h
+++ b/examples/toneMelody/pitches.h
diff --git a/tests/toneMelody/toneMelody.ino b/examples/toneMelody/toneMelody.ino
index 8593ab7..8593ab7 100644
--- a/tests/toneMelody/toneMelody.ino
+++ b/examples/toneMelody/toneMelody.ino
diff --git a/script/runtests.sh b/script/runtests.sh
deleted file mode 100755
index ad42f74..0000000
--- a/script/runtests.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/env bash
-
-failures=()
-
-for dir in tests/*/
-do
- dir=${dir%*/}
- example=${dir##*/}
- 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
diff --git a/script/bootstrap.sh b/tests/script/bootstrap.sh
index 083bf5d..083bf5d 100755
--- a/script/bootstrap.sh
+++ b/tests/script/bootstrap.sh
diff --git a/script/bootstrap/arduino.sh b/tests/script/bootstrap/arduino.sh
index 3c7e9d7..3c7e9d7 100644
--- a/script/bootstrap/arduino.sh
+++ b/tests/script/bootstrap/arduino.sh
diff --git a/script/bootstrap/chipkit.sh b/tests/script/bootstrap/chipkit.sh
index efe9615..efe9615 100644
--- a/script/bootstrap/chipkit.sh
+++ b/tests/script/bootstrap/chipkit.sh
diff --git a/script/bootstrap/common.sh b/tests/script/bootstrap/common.sh
index 695d6b7..a6b6415 100644
--- a/script/bootstrap/common.sh
+++ b/tests/script/bootstrap/common.sh
@@ -132,7 +132,7 @@ if [ -z $COMMON_SOURCED ]; then
echo "Storing all downloaded dependencies in the \"dependencies\" folder"
- DEPENDENCIES_FOLDER="dependencies"
+ DEPENDENCIES_FOLDER="/var/tmp/Arduino-Makefile-testing-dependencies"
mkdir -p $DEPENDENCIES_FOLDER
if ! command -v make >/dev/null 2>&1; then
diff --git a/script/bootstrap/pip-requirements.txt b/tests/script/bootstrap/pip-requirements.txt
index 8313187..8313187 100644
--- a/script/bootstrap/pip-requirements.txt
+++ b/tests/script/bootstrap/pip-requirements.txt
diff --git a/tests/script/runtests.sh b/tests/script/runtests.sh
new file mode 100755
index 0000000..5f513da
--- /dev/null
+++ b/tests/script/runtests.sh
@@ -0,0 +1,48 @@
+#!/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