2008-04-23 17:19:13 +02:00
|
|
|
#!/bin/bash
|
2008-04-22 16:29:05 +02:00
|
|
|
|
2008-09-17 23:42:19 +02:00
|
|
|
if [ -z "$CONTIKI" ]; then
|
|
|
|
echo Undefined variable: CONTIKI
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$MAILTO" ]; then
|
|
|
|
echo Undefined variable: MAILTO
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2008-09-20 12:17:32 +02:00
|
|
|
function mail_report {
|
|
|
|
echo ">>>>>>> Sending mail <<<<<<<<"
|
|
|
|
cp $LOG ~/lastlog.log
|
|
|
|
cat $LOG | mail -s "Contiki test results" $MAILTO
|
|
|
|
}
|
|
|
|
|
2008-04-29 06:43:27 +02:00
|
|
|
echo ">>>>>>> Cleaning up previous tests <<<<<<<<"
|
|
|
|
rm -f *.log *.cooja_log
|
|
|
|
rm -fr se obj_cooja
|
|
|
|
rm -f symbols.c symbols.h
|
2008-04-24 08:17:26 +02:00
|
|
|
|
2008-04-29 06:43:27 +02:00
|
|
|
echo ">>>>>>> Creating test log <<<<<<<<"
|
2008-09-18 09:38:48 +02:00
|
|
|
#LOG="TEST-`date '+%F'`.log"
|
|
|
|
LOG=currentlog.log
|
2008-04-23 17:19:13 +02:00
|
|
|
touch $LOG
|
2008-09-18 17:10:11 +02:00
|
|
|
echo "Starting test run `date '+%F %T'`"
|
|
|
|
echo "Test run started at `date '+%F %T'`" >> $LOG
|
2008-09-18 09:38:48 +02:00
|
|
|
echo "" >> $LOG
|
2008-09-18 09:25:27 +02:00
|
|
|
|
|
|
|
echo ">>>>>>> Updating from CVS <<<<<<<<"
|
2008-09-20 12:17:32 +02:00
|
|
|
echo -n "Updating CVS: " >> $LOG
|
2008-09-18 09:25:27 +02:00
|
|
|
(cd $CONTIKI && cvs update -dP)
|
2008-09-20 12:17:32 +02:00
|
|
|
if [ "$?" != "0" ]; then
|
|
|
|
echo "FAIL" >> $LOG
|
|
|
|
mail_report
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
echo "OK" >> $LOG
|
2008-09-18 09:25:27 +02:00
|
|
|
|
|
|
|
echo ">>>>>>> Building COOJA <<<<<<<<"
|
2008-09-20 12:17:32 +02:00
|
|
|
echo -n "Building COOJA: " >> $LOG
|
2008-09-18 09:25:27 +02:00
|
|
|
(cd $CONTIKI/tools/cooja && ant clean && ant jar)
|
2008-09-20 12:17:32 +02:00
|
|
|
if [ "$?" != "0" ]; then
|
|
|
|
echo "FAIL" >> $LOG
|
|
|
|
mail_report
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
echo "OK" >> $LOG
|
2008-04-24 08:17:26 +02:00
|
|
|
|
2008-09-18 17:10:11 +02:00
|
|
|
echo "" >> $LOG
|
2008-04-22 16:29:05 +02:00
|
|
|
for myfile in ./*.csc
|
|
|
|
do
|
2008-09-17 23:42:19 +02:00
|
|
|
TEST=`basename $myfile .csc`
|
|
|
|
./RUN_TEST $TEST $LOG
|
|
|
|
echo "" >> $LOG
|
2008-04-23 17:19:13 +02:00
|
|
|
done
|
2008-04-29 06:43:27 +02:00
|
|
|
|
2008-09-20 12:17:32 +02:00
|
|
|
mail_report
|