nes-proj/tools/cooja/contiki_tests/RUN_ALL

67 lines
1.6 KiB
Plaintext
Raw Normal View History

2008-04-23 15:19:13 +00:00
#!/bin/bash
2008-04-22 14:29:05 +00:00
2008-04-29 04:43:27 +00:00
echo ">>>>>>> Cleaning up previous tests <<<<<<<<"
rm -f *.log *.cooja_log
rm -fr se obj_cooja
rm -f symbols.c symbols.h
2008-04-24 06:17:26 +00:00
2008-04-29 04:43:27 +00:00
echo ">>>>>>> Updating from CVS <<<<<<<<"
(cd $CONTIKI && cvs update -dP)
2008-04-22 14:29:05 +00:00
2008-04-29 04:43:27 +00:00
echo ">>>>>>> Building COOJA <<<<<<<<"
(cd $CONTIKI/tools/cooja && ant jar)
echo ">>>>>>> Creating test log <<<<<<<<"
2008-04-24 06:17:26 +00:00
rm -f *.log
2008-04-23 15:19:13 +00:00
LOG="TEST-`date '+%F'`.log"
touch $LOG
2008-04-29 04:43:27 +00:00
echo "" >> $LOG
2008-04-24 06:17:26 +00:00
echo "Starting test run ($LOG)"
2008-04-22 14:29:05 +00:00
for myfile in ./*.csc
do
TEST=`basename $myfile .csc`
2008-04-23 15:19:13 +00:00
echo ">>>>>>> Starting test: $TEST <<<<<<<<"
2008-04-22 14:29:05 +00:00
java -jar ../dist/cooja.jar -nogui -test=$TEST
2008-04-23 15:19:13 +00:00
if [ -f "COOJA.log" ]; then
mv COOJA.log $TEST.cooja_log
fi
if [ -f "$TEST.log" ]; then
OK=`grep "TEST OK" $TEST.log | wc -l`
if [ $OK == 0 ]; then
echo "$TEST: FAIL" >> $LOG
if [ -f "$TEST.info" ]; then
2008-04-24 06:17:26 +00:00
echo "--LOG INFO START ($TEST.info) --" >> $LOG
2008-04-23 15:19:13 +00:00
cat $TEST.info >> $LOG
echo "--LOG INFO END --" >> $LOG
echo "" >> $LOG
2008-04-24 06:17:26 +00:00
else
echo "-- NO TEST INFO AVAILABLE ($TEST.info) --" >> $LOG
2008-04-23 15:19:13 +00:00
fi
else
echo "$TEST: OK" >> $LOG
fi
else
echo "$TEST: FAIL (no output)" >> $LOG
if [ -f "$TEST.info" ]; then
2008-04-24 06:17:26 +00:00
echo "--LOG INFO START ($TEST.info) --" >> $LOG
2008-04-23 15:19:13 +00:00
cat $TEST.info >> $LOG
2008-04-24 06:17:26 +00:00
echo "-- TEST INFO END --" >> $LOG
2008-04-23 15:19:13 +00:00
echo "" >> $LOG
2008-04-24 06:17:26 +00:00
else
echo "-- NO TEST INFO AVAILABLE ($TEST.info) --" >> $LOG
2008-04-23 15:19:13 +00:00
fi
fi
echo "" >> $LOG
done
2008-04-29 04:43:27 +00:00
echo "Sending mail"
cat $LOG | mail -s "Test results (simulation-based)" [email]