From 49520f6f389c47625dd2db7d961406b25dde880e Mon Sep 17 00:00:00 2001 From: fros4943 Date: Mon, 18 May 2009 09:08:48 +0000 Subject: [PATCH] script for running several repeated tests --- tools/cooja/contiki_tests/RUN_REPEATED | 42 ++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 tools/cooja/contiki_tests/RUN_REPEATED diff --git a/tools/cooja/contiki_tests/RUN_REPEATED b/tools/cooja/contiki_tests/RUN_REPEATED new file mode 100644 index 000000000..349aed1c3 --- /dev/null +++ b/tools/cooja/contiki_tests/RUN_REPEATED @@ -0,0 +1,42 @@ +#!/bin/bash + +# Usage +if [ $# -eq 2 ]; then + REPEATS=$1 + TEST=$2 +else + echo "Usage: $0 " + echo "Example: $0 10 cooja_helloworld" + exit 1 +fi + +# Locate Contiki/COOJA +if [ -z "$CONTIKI" ]; then + if [ -z "$CONTIKI_HOME" ]; then + CONTIKI_HOME=../../.. + fi + CONTIKI=$CONTIKI_HOME +fi + +# Clean up +rm -f *.log *.cooja_log +rm -fr se obj_cooja +rm -f symbols.c symbols.h + +# Compile COOJA +echo ">>>>>>> Building COOJA <<<<<<<<" +(cd $CONTIKI/tools/cooja && ant clean && ant jar) +if [ "$?" != "0" ]; then + echo "Compilation of COOJA failed" + exit 1 +fi + +# Run tests +for COUNTER in `seq 1 $REPEATS`; +do + echo ">>>>>>> Repeating $COUNTER/$REPEATS <<<<<<<<" + bash RUN_TEST $TEST $TEST$COUNTER.log +done + +echo +echo ">>>>>>> DONE! Test logs stored in $TEST[1-$REPEATS].log <<<<<<<<"