aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Peplin <chris.peplin@rhubarbtech.com>2014-09-09 23:09:35 -0400
committerChristopher Peplin <chris.peplin@rhubarbtech.com>2014-09-09 23:17:15 -0400
commitc86ce093ce93eb8da1136acd1e81973ef0bb54fc (patch)
tree9113fe08113c3548b84ba02b4d55db8cee49395f
parente30bb5c28a42152007d70325477f364605b73f34 (diff)
Add a script to compile examples as an automated test suite.
* Added script/boostrap.sh to download the Arduino IDE and MPIDE (for chipKIT). Tested in Linux, should work in Cygwin and OS X too. * Added script/runtests.sh to run "make" in each example project and collect the results. The script returns -1 if any fails. * Moved currently testable examples to a "tests" directory, separate from examples that require alternative cores.
-rw-r--r--.gitignore2
-rw-r--r--README.md7
-rw-r--r--examples/ATtinyBlink/Makefile2
-rw-r--r--examples/README.md10
-rw-r--r--examples/TinySoftWareSerial/Makefile1
-rw-r--r--examples/toneMelody/Makefile4
-rwxr-xr-xscript/bootstrap.sh9
-rw-r--r--script/bootstrap/arduino.sh44
-rw-r--r--script/bootstrap/chipkit.sh61
-rw-r--r--script/bootstrap/common.sh191
-rw-r--r--script/bootstrap/pip-requirements.txt1
-rwxr-xr-xscript/runtests.sh28
-rw-r--r--tests/AnalogInOutSerial/AnalogInOutSerial.ino (renamed from examples/AnalogInOutSerial/AnalogInOutSerial.ino)0
-rw-r--r--tests/AnalogInOutSerial/Makefile (renamed from examples/Fade/Makefile)1
-rw-r--r--tests/Blink/Blink.ino (renamed from examples/Blink/Blink.ino)0
-rw-r--r--tests/Blink/Makefile (renamed from examples/Blink/Makefile)1
-rw-r--r--tests/BlinkChipKIT/BlinkChipKIT.pde (renamed from examples/BlinkChipKIT/BlinkChipKIT.pde)0
-rw-r--r--tests/BlinkChipKIT/Makefile (renamed from examples/BlinkChipKIT/Makefile)1
-rw-r--r--tests/BlinkInAVRC/Makefile (renamed from examples/BlinkInAVRC/Makefile)1
-rw-r--r--tests/BlinkInAVRC/blink.c (renamed from examples/BlinkInAVRC/blink.c)0
-rw-r--r--tests/BlinkWithoutDelay/BlinkWithoutDelay.ino (renamed from examples/BlinkWithoutDelay/BlinkWithoutDelay.ino)0
-rw-r--r--tests/BlinkWithoutDelay/Makefile (renamed from examples/AnalogInOutSerial/Makefile)1
-rw-r--r--tests/Fade/Fade.ino (renamed from examples/Fade/Fade.ino)0
-rw-r--r--tests/Fade/Makefile (renamed from examples/BlinkWithoutDelay/Makefile)1
-rw-r--r--tests/HelloWorld/HelloWorld.ino (renamed from examples/HelloWorld/HelloWorld.ino)0
-rw-r--r--tests/HelloWorld/Makefile (renamed from examples/HelloWorld/Makefile)1
-rw-r--r--tests/TestSuiteCommon.mk13
-rw-r--r--tests/WebServer/Makefile (renamed from examples/WebServer/Makefile)1
-rw-r--r--tests/WebServer/WebServer.ino (renamed from examples/WebServer/WebServer.ino)0
-rw-r--r--tests/master_reader/Makefile (renamed from examples/master_reader/Makefile)1
-rw-r--r--tests/master_reader/master_reader.ino (renamed from examples/master_reader/master_reader.ino)0
-rw-r--r--tests/toneMelody/Makefile5
-rw-r--r--tests/toneMelody/pitches.h (renamed from examples/toneMelody/pitches.h)0
-rw-r--r--tests/toneMelody/toneMelody.ino (renamed from examples/toneMelody/toneMelody.ino)0
34 files changed, 379 insertions, 8 deletions
diff --git a/.gitignore b/.gitignore
index 06cff06..a0d6d59 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
*.o
build-cli
/.project
+/dependencies
+build-*
diff --git a/README.md b/README.md
index 50785b0..5b24604 100644
--- a/README.md
+++ b/README.md
@@ -212,6 +212,13 @@ Then, the following line must be added to the project Makefile :
$(CXX_NAME) -c -include Arduino.h -x c++ $(CXXFLAGS) $(CPPFLAGS) -fsyntax-only $(CHK_SOURCES)
```
+## 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.
+
### Bare-Arduino–Project
If you are planning on using this makefile in a larger/professional project, you might want to take a look at the [Bare-Arduino–Project](https://github.com/WeAreLeka/Bare-Arduino-Project) framework.
diff --git a/examples/ATtinyBlink/Makefile b/examples/ATtinyBlink/Makefile
index a89de1c..b4e49be 100644
--- a/examples/ATtinyBlink/Makefile
+++ b/examples/ATtinyBlink/Makefile
@@ -1,6 +1,6 @@
# Arduino Make file. Refer to https://github.com/sudar/Arduino-Makefile
-# if you have placed the alternate core in your sketchbook directory, then you can just mention the core name alone.
+# if you have placed the alternate core in your sketchbook directory, then you can just mention the core name alone.
ALTERNATE_CORE = attiny
# If not, you might have to include the full path.
#ALTERNATE_CORE_PATH = /home/sudar/Dropbox/code/arduino-sketches/hardware/attiny/
diff --git a/examples/README.md b/examples/README.md
index b170cdc..39425b3 100644
--- a/examples/README.md
+++ b/examples/README.md
@@ -1,7 +1,11 @@
-This folder contains the list of example Arduino sketches and makefile showing the different usage patterns
+This folder contains the list of example Arduino sketches and makefile showing
+the different usage patterns
+
+- BlinkInAVRC - Shows how to use plain AVR C code
+- ATtinyBlink - Shows how to use different cores like ATtiny
+
+These three examples are a step back, in the "tests" directory.
- Blink - Shows normal usage
- HelloWorld - Shows how to include Arduino libraries
-- BlinkInAVRC - Shows how to use plain AVR C code
- BlinkChipKIT - Shows how to use ChipKIT
-- ATtinyBlink - Shows how to use different cores like ATtiny
diff --git a/examples/TinySoftWareSerial/Makefile b/examples/TinySoftWareSerial/Makefile
index 08f918d..991e57e 100644
--- a/examples/TinySoftWareSerial/Makefile
+++ b/examples/TinySoftWareSerial/Makefile
@@ -9,6 +9,7 @@ BOARD_TAG = attiny85-8
ARDUINO_LIBS = SoftwareSerial
+include ../TestSuiteCommon.mk
include $(ARDMK_DIR)/Arduino.mk
# !!! Important. You have to use make ispload to upload when using ISP programmer
diff --git a/examples/toneMelody/Makefile b/examples/toneMelody/Makefile
deleted file mode 100644
index 3dea6c0..0000000
--- a/examples/toneMelody/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-BOARD_TAG = uno
-ARDUINO_LIBS =
-
-include ../../Arduino.mk
diff --git a/script/bootstrap.sh b/script/bootstrap.sh
new file mode 100755
index 0000000..083bf5d
--- /dev/null
+++ b/script/bootstrap.sh
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+
+set -e
+
+SCRIPTS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+pushd $SCRIPTS_DIR/..
+
+source $SCRIPTS_DIR/bootstrap/chipkit.sh
+source $SCRIPTS_DIR/bootstrap/arduino.sh
diff --git a/script/bootstrap/arduino.sh b/script/bootstrap/arduino.sh
new file mode 100644
index 0000000..3c7e9d7
--- /dev/null
+++ b/script/bootstrap/arduino.sh
@@ -0,0 +1,44 @@
+set -e
+BOOTSTRAP_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+source $BOOTSTRAP_DIR/common.sh
+
+echo "Installing dependencies for building for the Arduino"
+
+if [ -z "$ARDUINO_DIR" ] || ! test -e $ARDUINO_DIR || [ $OS == "cygwin" ]; then
+
+ echo "Installing Arduino..."
+
+ ARDUINO_BASENAME="arduino-1.0.5"
+ if [ $OS == "cygwin" ]; then
+ ARDUINO_FILE="$ARDUINO_BASENAME-r2-windows".zip
+ EXTRACT_COMMAND="unzip -q"
+ elif [ $OS == "mac" ]; then
+ ARDUINO_FILE="$ARDUINO_BASENAME-macosx".zip
+ EXTRACT_COMMAND="unzip -q"
+ else
+ ARDUINO_FILE="$ARDUINO_BASENAME-linux64".tgz
+ EXTRACT_COMMAND="tar -xzf"
+ fi
+
+ ARDUINO_URL=http://arduino.googlecode.com/files/$ARDUINO_FILE
+
+ _pushd $DEPENDENCIES_FOLDER
+ if ! test -e $ARDUINO_FILE
+ then
+ echo "Downloading Arduino IDE..."
+ download $ARDUINO_URL $ARDUINO_FILE
+ fi
+
+ if ! test -d $ARDUINO_BASENAME
+ then
+ echo "Installing Arduino to local folder..."
+ $EXTRACT_COMMAND $ARDUINO_FILE
+ echo "Arduino installed"
+ fi
+
+ _popd
+
+fi
+
+echo
+echo "${bldgreen}Arduino dependencies installed.$txtrst"
diff --git a/script/bootstrap/chipkit.sh b/script/bootstrap/chipkit.sh
new file mode 100644
index 0000000..efe9615
--- /dev/null
+++ b/script/bootstrap/chipkit.sh
@@ -0,0 +1,61 @@
+set -e
+BOOTSTRAP_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+source $BOOTSTRAP_DIR/common.sh
+
+echo "Installing dependencies for building for the chipKIT"
+
+
+if [ -z "$MPIDE_DIR" ] || ! test -e $MPIDE_DIR || [ $OS == "cygwin" ]; then
+
+ echo "Installing MPIDE..."
+
+ if [ $OS == "cygwin" ]; then
+ MPIDE_BASENAME="mpide-0023-windows-20130715"
+ MPIDE_FILE="$MPIDE_BASENAME".zip
+ EXTRACT_COMMAND="unzip -q"
+ if ! command -v unzip >/dev/null 2>&1; then
+ _cygwin_error "unzip"
+ fi
+ elif [ $OS == "mac" ]; then
+ MPIDE_BASENAME=mpide-0023-macosx-20130715
+ MPIDE_FILE="$MPIDE_BASENAME".dmg
+ else
+ MPIDE_BASENAME=mpide-0023-linux64-20130817-test
+ MPIDE_FILE="$MPIDE_BASENAME".tgz
+ EXTRACT_COMMAND="tar -xzf"
+ fi
+
+ MPIDE_URL=http://chipkit.s3.amazonaws.com/builds/$MPIDE_FILE
+
+ _pushd $DEPENDENCIES_FOLDER
+ if ! test -e $MPIDE_FILE
+ then
+ echo "Downloading MPIDE..."
+ download $MPIDE_URL $MPIDE_FILE
+ fi
+
+ if ! test -d $MPIDE_BASENAME
+ then
+ echo "Installing MPIDE to local folder..."
+ if [ $OS == "mac" ]; then
+ hdiutil attach $MPIDE_FILE
+ cp -R /Volumes/Mpide/Mpide.app/Contents/Resources/Java $MPIDE_BASENAME
+ hdiutil detach /Volumes/Mpide
+ else
+ $EXTRACT_COMMAND $MPIDE_FILE
+ fi
+ echo "MPIDE installed"
+ fi
+
+ if [ $OS == "cygwin" ]; then
+ chmod a+x mpide/hardware/pic32/compiler/pic32-tools/bin/*
+ chmod a+x -R mpide/hardware/pic32/compiler/pic32-tools/pic32mx/
+ chmod a+x mpide/*.dll
+ chmod a+x mpide/hardware/tools/avr/bin/*
+ fi
+ _popd
+
+fi
+
+echo
+echo "${bldgreen}chipKIT dependencies installed.$txtrst"
diff --git a/script/bootstrap/common.sh b/script/bootstrap/common.sh
new file mode 100644
index 0000000..695d6b7
--- /dev/null
+++ b/script/bootstrap/common.sh
@@ -0,0 +1,191 @@
+#!/usr/bin/env bash
+
+set -e
+BOOTSTRAP_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+
+if [ -z $COMMON_SOURCED ]; then
+
+ # TODO this is kind of a hacky way of determining if root is required -
+ # ideally we wouuld set up a little virtualenv in the dependencies folder
+ SUDO_CMD=
+ if command -v sudo >/dev/null 2>&1; then
+ SUDO_CMD="sudo -E"
+
+ if [ -z $CI ] && [ -z $VAGRANT ]; then
+ echo "The bootstrap script needs to install a few packages to your system as an admin, and we will use the 'sudo' command - enter your password to continue"
+ $SUDO_CMD ls > /dev/null
+ fi
+ fi
+
+ KERNEL=`uname`
+ ARCH=`uname -m`
+ if [ ${KERNEL:0:7} == "MINGW32" ]; then
+ OS="windows"
+ elif [ ${KERNEL:0:6} == "CYGWIN" ]; then
+ OS="cygwin"
+ elif [ $KERNEL == "Darwin" ]; then
+ OS="mac"
+ else
+ OS="linux"
+ if ! command -v lsb_release >/dev/null 2>&1; then
+ # Arch Linux
+ if command -v pacman>/dev/null 2>&1; then
+ $SUDO_CMD pacman -S lsb-release
+ fi
+ fi
+
+ DISTRO=`lsb_release -si`
+ fi
+
+
+ die() {
+ echo >&2 "${bldred}$@${txtrst}"
+ exit 1
+ }
+
+ _cygwin_error() {
+ echo
+ echo "${bldred}Missing \"$1\"${txtrst} - run the Cygwin installer again and select the base package set:"
+ echo " $CYGWIN_PACKAGES"
+ echo "After installing the packages, re-run this bootstrap script."
+ die
+ }
+
+ if ! command -v tput >/dev/null 2>&1; then
+ if [ $OS == "cygwin" ]; then
+ echo "OPTIONAL: Install the \"ncurses\" package in Cygwin to get colored shell output"
+ fi
+ else
+ set +e
+ # These exit with 1 when provisioning in a Vagrant box...?
+ txtrst=$(tput sgr0) # reset
+ bldred=${txtbld}$(tput setaf 1)
+ bldgreen=${txtbld}$(tput setaf 2)
+ set -e
+ fi
+
+
+ _pushd() {
+ pushd $1 > /dev/null
+ }
+
+ _popd() {
+ popd > /dev/null
+ }
+
+ _wait() {
+ if [ -z $CI ] && [ -z $VAGRANT ]; then
+ echo "Press Enter when done"
+ read
+ fi
+ }
+
+ _install() {
+ if [ $OS == "cygwin" ]; then
+ _cygwin_error $1
+ elif [ $OS == "mac" ]; then
+ # brew exists with 1 if it's already installed
+ set +e
+ brew install $1
+ set -e
+ else
+ if [ -z $DISTRO ]; then
+ echo
+ echo "Missing $1 - install it using your distro's package manager or build from source"
+ _wait
+ else
+ if [ $DISTRO == "arch" ]; then
+ $SUDO_CMD pacman -S $1
+ elif [ $DISTRO == "Ubuntu" ]; then
+ $SUDO_CMD apt-get update -qq
+ $SUDO_CMD apt-get install $1 -y
+ else
+ echo
+ echo "Missing $1 - install it using your distro's package manager or build from source"
+ _wait
+ fi
+ fi
+ fi
+ }
+
+ download() {
+ url=$1
+ filename=$2
+ curl $url -L -o $filename
+ }
+
+ if [ `id -u` == 0 ]; then
+ die "Error: running as root - don't use 'sudo' with this script"
+ fi
+
+ if ! command -v unzip >/dev/null 2>&1; then
+ _install "unzip"
+ fi
+
+ if ! command -v curl >/dev/null 2>&1; then
+ if [ $OS == "cygwin" ]; then
+ _cygwin_error "curl"
+ else
+ _install curl
+ fi
+ fi
+
+ echo "Storing all downloaded dependencies in the \"dependencies\" folder"
+
+ DEPENDENCIES_FOLDER="dependencies"
+ mkdir -p $DEPENDENCIES_FOLDER
+
+ if ! command -v make >/dev/null 2>&1; then
+ if [ $OS == "cygwin" ]; then
+ _cygwin_error "make"
+ elif [ $OS == "mac" ]; then
+ die "Missing 'make' - install the Xcode CLI tools"
+ else
+ if [ $DISTRO == "arch" ]; then
+ _install "base-devel"
+ elif [ $DISTRO == "Ubuntu" ]; then
+ _install "build-essential"
+ fi
+ fi
+ fi
+
+ if [ $DISTRO == "Ubuntu" ] && [ $ARCH == "x86_64" ]; then
+ _install "libc6-i386"
+ _install "lib32gcc1"
+ fi
+
+ if ! command -v g++ >/dev/null 2>&1; then
+ if [ $DISTRO == "Ubuntu" ]; then
+ _install "g++"
+ fi
+ fi
+
+ if ! command -v python >/dev/null 2>&1; then
+ echo "Installing Python..."
+ _install "python"
+ fi
+
+ if ! command -v pip >/dev/null 2>&1; then
+ echo "Installing Pip..."
+ if ! command -v easy_install >/dev/null 2>&1; then
+ _install "python-setuptools"
+ fi
+
+ if ! command -v easy_install >/dev/null 2>&1; then
+ die "easy_install not available, can't install pip"
+ fi
+
+ $SUDO_CMD easy_install pip
+ fi
+
+ PIP_SUDO_CMD=
+ if [ -z $VIRTUAL_ENV ]; then
+ # Only use sudo if the user doesn't have an active virtualenv
+ PIP_SUDO_CMD=$SUDO_CMD
+ fi
+
+ $PIP_SUDO_CMD pip install --upgrade setuptools
+ $PIP_SUDO_CMD pip install --src dependencies --pre -Ur $BOOTSTRAP_DIR/pip-requirements.txt
+
+ COMMON_SOURCED=1
+fi
diff --git a/script/bootstrap/pip-requirements.txt b/script/bootstrap/pip-requirements.txt
new file mode 100644
index 0000000..8313187
--- /dev/null
+++ b/script/bootstrap/pip-requirements.txt
@@ -0,0 +1 @@
+pyserial==2.7
diff --git a/script/runtests.sh b/script/runtests.sh
new file mode 100755
index 0000000..ad42f74
--- /dev/null
+++ b/script/runtests.sh
@@ -0,0 +1,28 @@
+#!/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/examples/AnalogInOutSerial/AnalogInOutSerial.ino b/tests/AnalogInOutSerial/AnalogInOutSerial.ino
index e142f69..e142f69 100644
--- a/examples/AnalogInOutSerial/AnalogInOutSerial.ino
+++ b/tests/AnalogInOutSerial/AnalogInOutSerial.ino
diff --git a/examples/Fade/Makefile b/tests/AnalogInOutSerial/Makefile
index 3dea6c0..872d069 100644
--- a/examples/Fade/Makefile
+++ b/tests/AnalogInOutSerial/Makefile
@@ -1,4 +1,5 @@
BOARD_TAG = uno
ARDUINO_LIBS =
+include ../TestSuiteCommon.mk
include ../../Arduino.mk
diff --git a/examples/Blink/Blink.ino b/tests/Blink/Blink.ino
index 1953c39..1953c39 100644
--- a/examples/Blink/Blink.ino
+++ b/tests/Blink/Blink.ino
diff --git a/examples/Blink/Makefile b/tests/Blink/Makefile
index 7678e9b..d41effa 100644
--- a/examples/Blink/Makefile
+++ b/tests/Blink/Makefile
@@ -1,5 +1,6 @@
BOARD_TAG = uno
ARDUINO_LIBS =
+include ../TestSuiteCommon.mk
include ../../Arduino.mk
diff --git a/examples/BlinkChipKIT/BlinkChipKIT.pde b/tests/BlinkChipKIT/BlinkChipKIT.pde
index 1953c39..1953c39 100644
--- a/examples/BlinkChipKIT/BlinkChipKIT.pde
+++ b/tests/BlinkChipKIT/BlinkChipKIT.pde
diff --git a/examples/BlinkChipKIT/Makefile b/tests/BlinkChipKIT/Makefile
index 87a9f7d..bec2794 100644
--- a/examples/BlinkChipKIT/Makefile
+++ b/tests/BlinkChipKIT/Makefile
@@ -1,5 +1,6 @@
BOARD_TAG = mega_pic32
ARDUINO_LIBS =
+include ../TestSuiteCommon.mk
include ../../chipKIT.mk
diff --git a/examples/BlinkInAVRC/Makefile b/tests/BlinkInAVRC/Makefile
index 04049bb..9080b24 100644
--- a/examples/BlinkInAVRC/Makefile
+++ b/tests/BlinkInAVRC/Makefile
@@ -11,6 +11,7 @@ F_CPU = 8000000L
ISP_PROG = stk500v1
AVRDUDE_ISP_BAUDRATE = 19200
+include ../TestSuiteCommon.mk
include $(ARDMK_DIR)/Arduino.mk
# !!! Important. You have to use make ispload to upload when using ISP programmer
diff --git a/examples/BlinkInAVRC/blink.c b/tests/BlinkInAVRC/blink.c
index d8b7c8f..d8b7c8f 100644
--- a/examples/BlinkInAVRC/blink.c
+++ b/tests/BlinkInAVRC/blink.c
diff --git a/examples/BlinkWithoutDelay/BlinkWithoutDelay.ino b/tests/BlinkWithoutDelay/BlinkWithoutDelay.ino
index 0143571..0143571 100644
--- a/examples/BlinkWithoutDelay/BlinkWithoutDelay.ino
+++ b/tests/BlinkWithoutDelay/BlinkWithoutDelay.ino
diff --git a/examples/AnalogInOutSerial/Makefile b/tests/BlinkWithoutDelay/Makefile
index 3dea6c0..872d069 100644
--- a/examples/AnalogInOutSerial/Makefile
+++ b/tests/BlinkWithoutDelay/Makefile
@@ -1,4 +1,5 @@
BOARD_TAG = uno
ARDUINO_LIBS =
+include ../TestSuiteCommon.mk
include ../../Arduino.mk
diff --git a/examples/Fade/Fade.ino b/tests/Fade/Fade.ino
index b47bf43..b47bf43 100644
--- a/examples/Fade/Fade.ino
+++ b/tests/Fade/Fade.ino
diff --git a/examples/BlinkWithoutDelay/Makefile b/tests/Fade/Makefile
index 3dea6c0..872d069 100644
--- a/examples/BlinkWithoutDelay/Makefile
+++ b/tests/Fade/Makefile
@@ -1,4 +1,5 @@
BOARD_TAG = uno
ARDUINO_LIBS =
+include ../TestSuiteCommon.mk
include ../../Arduino.mk
diff --git a/examples/HelloWorld/HelloWorld.ino b/tests/HelloWorld/HelloWorld.ino
index e99957d..e99957d 100644
--- a/examples/HelloWorld/HelloWorld.ino
+++ b/tests/HelloWorld/HelloWorld.ino
diff --git a/examples/HelloWorld/Makefile b/tests/HelloWorld/Makefile
index fb94fdd..0af2ed4 100644
--- a/examples/HelloWorld/Makefile
+++ b/tests/HelloWorld/Makefile
@@ -1,4 +1,5 @@
BOARD_TAG = uno
ARDUINO_LIBS = LiquidCrystal
+include ../TestSuiteCommon.mk
include ../../Arduino.mk
diff --git a/tests/TestSuiteCommon.mk b/tests/TestSuiteCommon.mk
new file mode 100644
index 0000000..5fa4f50
--- /dev/null
+++ b/tests/TestSuiteCommon.mk
@@ -0,0 +1,13 @@
+ARDMK_DIR=../../
+DEPENDENCIES_FOLDER = ../../dependencies
+DEPENDENCIES_MPIDE_DIR = $(DEPENDENCIES_FOLDER)/mpide-0023-linux64-20130817-test
+
+ifeq ($(MPIDE_DIR),)
+ MPIDE_DIR = $(DEPENDENCIES_MPIDE_DIR)
+endif
+
+DEPENDENCIES_ARDUINO_DIR = $(DEPENDENCIES_FOLDER)/arduino-1.0.5
+
+ifeq ($(ARDUINO_DIR),)
+ ARDUINO_DIR = $(DEPENDENCIES_ARDUINO_DIR)
+endif
diff --git a/examples/WebServer/Makefile b/tests/WebServer/Makefile
index 51b9ac2..5fbefae 100644
--- a/examples/WebServer/Makefile
+++ b/tests/WebServer/Makefile
@@ -3,4 +3,5 @@
BOARD_TAG = uno
ARDUINO_LIBS = Ethernet SPI
+include ../TestSuiteCommon.mk
include ../../Arduino.mk
diff --git a/examples/WebServer/WebServer.ino b/tests/WebServer/WebServer.ino
index fb2a1b9..fb2a1b9 100644
--- a/examples/WebServer/WebServer.ino
+++ b/tests/WebServer/WebServer.ino
diff --git a/examples/master_reader/Makefile b/tests/master_reader/Makefile
index 3030deb..8a42a8e 100644
--- a/examples/master_reader/Makefile
+++ b/tests/master_reader/Makefile
@@ -3,4 +3,5 @@
BOARD_TAG = uno
ARDUINO_LIBS = Wire
+include ../TestSuiteCommon.mk
include ../../Arduino.mk
diff --git a/examples/master_reader/master_reader.ino b/tests/master_reader/master_reader.ino
index 4124d7d..4124d7d 100644
--- a/examples/master_reader/master_reader.ino
+++ b/tests/master_reader/master_reader.ino
diff --git a/tests/toneMelody/Makefile b/tests/toneMelody/Makefile
new file mode 100644
index 0000000..872d069
--- /dev/null
+++ b/tests/toneMelody/Makefile
@@ -0,0 +1,5 @@
+BOARD_TAG = uno
+ARDUINO_LIBS =
+
+include ../TestSuiteCommon.mk
+include ../../Arduino.mk
diff --git a/examples/toneMelody/pitches.h b/tests/toneMelody/pitches.h
index 55c7d54..55c7d54 100644
--- a/examples/toneMelody/pitches.h
+++ b/tests/toneMelody/pitches.h
diff --git a/examples/toneMelody/toneMelody.ino b/tests/toneMelody/toneMelody.ino
index 8593ab7..8593ab7 100644
--- a/examples/toneMelody/toneMelody.ino
+++ b/tests/toneMelody/toneMelody.ino