From 683f05302e83ab98c32363017553a94a4635fe1b Mon Sep 17 00:00:00 2001 From: fros4943 Date: Wed, 23 Apr 2008 15:19:13 +0000 Subject: [PATCH] updated version --- tools/cooja/contiki_tests/RUN_ALL | 41 ++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/tools/cooja/contiki_tests/RUN_ALL b/tools/cooja/contiki_tests/RUN_ALL index dbfbe3d85..8e7c92999 100644 --- a/tools/cooja/contiki_tests/RUN_ALL +++ b/tools/cooja/contiki_tests/RUN_ALL @@ -1,13 +1,46 @@ -#!/usr/bin/env bash +#!/bin/bash echo "Running tests" +rm -f *.log -rm *.log +LOG="TEST-`date '+%F'`.log" +touch $LOG for myfile in ./*.csc do TEST=`basename $myfile .csc` - echo Starting test: $TEST + echo ">>>>>>> Starting test: $TEST <<<<<<<<" java -jar ../dist/cooja.jar -nogui -test=$TEST -done \ No newline at end of file + 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