osd-contiki/tools/cooja/contiki_tests/RUN_ALL

47 lines
985 B
Plaintext
Raw Normal View History

2008-04-23 17:19:13 +02:00
#!/bin/bash
2008-04-22 16:29:05 +02:00
echo "Running tests"
2008-04-23 17:19:13 +02:00
rm -f *.log
2008-04-22 16:29:05 +02:00
2008-04-23 17:19:13 +02:00
LOG="TEST-`date '+%F'`.log"
touch $LOG
2008-04-22 16:29:05 +02:00
for myfile in ./*.csc
do
TEST=`basename $myfile .csc`
2008-04-23 17:19:13 +02:00
echo ">>>>>>> Starting test: $TEST <<<<<<<<"
2008-04-22 16:29:05 +02:00
java -jar ../dist/cooja.jar -nogui -test=$TEST
2008-04-23 17:19:13 +02: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
echo "--LOG INFO START --" >> $LOG
cat $TEST.info >> $LOG
echo "--LOG INFO END --" >> $LOG
echo "" >> $LOG
fi
else
echo "$TEST: OK" >> $LOG
fi
else
echo "$TEST: FAIL (no output)" >> $LOG
if [ -f "$TEST.info" ]; then
echo "--LOG INFO START --" >> $LOG
cat $TEST.info >> $LOG
echo "--LOG INFO END --" >> $LOG
echo "" >> $LOG
fi
fi
echo "" >> $LOG
done