2009-05-18 11:08:48 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Usage
|
|
|
|
if [ $# -eq 2 ]; then
|
|
|
|
REPEATS=$1
|
|
|
|
TEST=$2
|
|
|
|
else
|
|
|
|
echo "Usage: $0 <nr_repeats> <test>"
|
|
|
|
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
|
2009-06-25 13:10:50 +02:00
|
|
|
echo ">>>>>>> Test $COUNTER/$REPEATS: $TEST-$COUNTER.log <<<<<<<<"
|
|
|
|
bash RUN_TEST $TEST RUN_REPEATED_LAST.log
|
|
|
|
mv $TEST.log $TEST-$COUNTER.log
|
2009-05-18 11:08:48 +02:00
|
|
|
done
|
|
|
|
|
|
|
|
echo
|
2009-06-25 13:10:50 +02:00
|
|
|
cat RUN_REPEATED_LAST.log
|
|
|
|
echo
|
|
|
|
echo ">>>>>>> DONE! Test logs stored in $TEST-[1-$REPEATS].log <<<<<<<<"
|