2008-09-17 21:41:30 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if [ -z "$2" ]; then
|
|
|
|
echo Usage: $0 [test] [logfile]
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
TEST=$1
|
|
|
|
LOG=$2
|
|
|
|
|
|
|
|
echo ">>>>>>> Starting test: $TEST <<<<<<<<"
|
|
|
|
java -jar ../dist/cooja.jar -nogui -test=$TEST
|
|
|
|
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
|
|
|
|
echo "--LOG INFO START ($TEST.info) --" >> $LOG
|
|
|
|
cat $TEST.info >> $LOG
|
|
|
|
echo "" >> $LOG
|
2008-09-18 10:22:25 +00:00
|
|
|
echo "--LOG INFO END --" >> $LOG
|
2008-09-17 21:41:30 +00:00
|
|
|
else
|
|
|
|
echo "-- NO TEST INFO AVAILABLE ($TEST.info) --" >> $LOG
|
|
|
|
fi
|
|
|
|
|
|
|
|
else
|
|
|
|
echo "$TEST: OK" >> $LOG
|
|
|
|
fi
|
|
|
|
|
|
|
|
else
|
|
|
|
echo "$TEST: FAIL (no output)" >> $LOG
|
|
|
|
if [ -f "$TEST.info" ]; then
|
|
|
|
echo "--LOG INFO START ($TEST.info) --" >> $LOG
|
|
|
|
cat $TEST.info >> $LOG
|
|
|
|
echo "" >> $LOG
|
2008-09-18 10:22:25 +00:00
|
|
|
echo "-- TEST INFO END --" >> $LOG
|
2008-09-17 21:41:30 +00:00
|
|
|
else
|
|
|
|
echo "-- NO TEST INFO AVAILABLE ($TEST.info) --" >> $LOG
|
|
|
|
fi
|
|
|
|
fi
|
2008-09-18 10:22:25 +00:00
|
|
|
|
|
|
|
echo "" >> $LOG
|