osd-contiki/tools/cooja/contiki_tests/RUN_TEST

41 lines
803 B
Plaintext
Raw Normal View History

2008-09-17 23:41:30 +02: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
OK=0
2008-09-17 23:41:30 +02:00
if [ -f "$TEST.log" ]; then
OK=`grep "TEST OK" $TEST.log | wc -l`
fi
2008-09-17 23:41:30 +02:00
if [ $OK == 0 ]; then
echo "$TEST: FAIL" >> $LOG
2008-09-17 23:41:30 +02:00
if [ -f "$TEST.info" ]; then
echo "--LOG INFO START ($TEST.info) --" >> $LOG
cat $TEST.info >> $LOG
echo "" >> $LOG
echo "--LOG INFO END --" >> $LOG
2008-09-17 23:41:30 +02:00
else
echo "-- NO LOG INFO AVAILABLE ($TEST.info) --" >> $LOG
2008-09-17 23:41:30 +02:00
fi
echo "-- OUTPUT TAIL START ($TEST.cooja_log) --" >> $LOG
tail -5 $TEST.cooja_log >> $LOG
echo "-- OUTPUT TAIL END --" >> $LOG
else
echo "$TEST: OK" >> $LOG
2008-09-17 23:41:30 +02:00
fi
2008-09-18 12:22:25 +02:00
echo "" >> $LOG