osd-contiki/tools/cooja/contiki_tests/RUN_ALL
2008-09-20 10:17:32 +00:00

61 lines
1.2 KiB
Bash

#!/bin/bash
if [ -z "$CONTIKI" ]; then
echo Undefined variable: CONTIKI
exit
fi
if [ -z "$MAILTO" ]; then
echo Undefined variable: MAILTO
exit
fi
function mail_report {
echo ">>>>>>> Sending mail <<<<<<<<"
cp $LOG ~/lastlog.log
cat $LOG | mail -s "Contiki test results" $MAILTO
}
echo ">>>>>>> Cleaning up previous tests <<<<<<<<"
rm -f *.log *.cooja_log
rm -fr se obj_cooja
rm -f symbols.c symbols.h
echo ">>>>>>> Creating test log <<<<<<<<"
#LOG="TEST-`date '+%F'`.log"
LOG=currentlog.log
touch $LOG
echo "Starting test run `date '+%F %T'`"
echo "Test run started at `date '+%F %T'`" >> $LOG
echo "" >> $LOG
echo ">>>>>>> Updating from CVS <<<<<<<<"
echo -n "Updating CVS: " >> $LOG
(cd $CONTIKI && cvs update -dP)
if [ "$?" != "0" ]; then
echo "FAIL" >> $LOG
mail_report
exit
fi
echo "OK" >> $LOG
echo ">>>>>>> Building COOJA <<<<<<<<"
echo -n "Building COOJA: " >> $LOG
(cd $CONTIKI/tools/cooja && ant clean && ant jar)
if [ "$?" != "0" ]; then
echo "FAIL" >> $LOG
mail_report
exit
fi
echo "OK" >> $LOG
echo "" >> $LOG
for myfile in ./*.csc
do
TEST=`basename $myfile .csc`
./RUN_TEST $TEST $LOG
echo "" >> $LOG
done
mail_report