printing tail of cooja output in test report

This commit is contained in:
fros4943 2008-09-18 15:10:11 +00:00
parent b9372090db
commit e3385f8e3b
2 changed files with 15 additions and 21 deletions

View file

@ -19,8 +19,8 @@ echo ">>>>>>> Creating test log <<<<<<<<"
#LOG="TEST-`date '+%F'`.log"
LOG=currentlog.log
touch $LOG
echo "Starting test run ($LOG)"
echo "Test run started: ($LOG)" >> $LOG
echo "Starting test run `date '+%F %T'`"
echo "Test run started at `date '+%F %T'`" >> $LOG
echo "" >> $LOG
echo ">>>>>>> Updating from CVS <<<<<<<<"
@ -32,6 +32,7 @@ echo "Building COOJA" >> $LOG
(cd $CONTIKI/tools/cooja && ant clean && ant jar)
echo "Starting tests" >> $LOG
echo "" >> $LOG
for myfile in ./*.csc
do
TEST=`basename $myfile .csc`

View file

@ -14,34 +14,27 @@ if [ -f "COOJA.log" ]; then
mv COOJA.log $TEST.cooja_log
fi
OK=0
if [ -f "$TEST.log" ]; then
OK=`grep "TEST OK" $TEST.log | wc -l`
fi
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
echo "--LOG INFO END --" >> $LOG
else
echo "-- NO TEST INFO AVAILABLE ($TEST.info) --" >> $LOG
fi
else
echo "$TEST: OK" >> $LOG
fi
else
echo "$TEST: FAIL (no output)" >> $LOG
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
echo "-- TEST INFO END --" >> $LOG
echo "--LOG INFO END --" >> $LOG
else
echo "-- NO TEST INFO AVAILABLE ($TEST.info) --" >> $LOG
echo "-- NO LOG INFO AVAILABLE ($TEST.info) --" >> $LOG
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
fi
echo "" >> $LOG