minor script updates

This commit is contained in:
fros4943 2009-06-24 14:41:47 +00:00
parent e6fa5334ae
commit 28a9b815b5
3 changed files with 27 additions and 5 deletions

View file

@ -24,7 +24,7 @@ done
if [ -z "$CONTIKI" ]; then
if [ -z "$CONTIKI_HOME" ]; then
CONTIKI_HOME=../../..
echo Undefined variable: CONTIKI. Using default: ${CONTIKI}
echo Undefined variable: CONTIKI_HOME. Using default: ${CONTIKI_HOME}
fi
CONTIKI=$CONTIKI_HOME
fi

View file

@ -35,7 +35,7 @@ fi
for COUNTER in `seq 1 $REPEATS`;
do
echo ">>>>>>> Repeating $COUNTER/$REPEATS <<<<<<<<"
bash RUN_TEST $TEST $TEST$COUNTER.log
bash RUN_TEST $TEST $TEST$COUNTER.log -keeplog
done
echo

View file

@ -1,14 +1,29 @@
#!/bin/bash
if [ $# -lt 1 -o $# -gt 2 ]; then
echo "Usage: $0 <test> [logfile]"
if [ $# -lt 1 -o $# -gt 3 ]; then
echo "Usage: $0 <test> [logfile] [-keeplog]"
exit
fi
TEST=$1
LOGFILE=0
if [ $# -eq 2 ]; then
if [ $# -gt 1 ]; then
LOGFILE=1
LOG=$2
if [ -f "$LOG" ]; then
rm $LOG
fi
fi
NO_LOG_PROCESSING=0
if [ $# -gt 2 ]; then
if [ $3 == "-keeplog" ]; then
NO_LOG_PROCESSING=1
else
echo "Usage: $0 <test> [logfile] [-keeplog]"
exit
fi
fi
echo ">>>>>>> Starting test: $TEST <<<<<<<<"
@ -32,6 +47,12 @@ if [ -f "$TEST.log" ]; then
OK=`grep "TEST OK" $TEST.log | wc -l`
fi
if [ $NO_LOG_PROCESSING -eq 1 ]; then
rm $LOG
mv $TEST.log $LOG
exit
fi
if [ $LOGFILE -eq 1 ]; then
if [ $OK == 0 ]; then
echo "FAIL" >> $LOG
@ -57,6 +78,7 @@ fi
if [ $OK == 0 ]; then
echo ">>>>>>> Finished test: $TEST FAILED <<<<<<<<"
echo ""
else
echo ">>>>>>> Finished test: $TEST OK <<<<<<<<"
fi