CI script tests: more homogeneous logs

This commit is contained in:
Simon Duquennoy 2017-11-17 14:24:28 -08:00
parent 53dd64a8c8
commit 2c1a739984
4 changed files with 18 additions and 45 deletions

View File

@ -46,14 +46,9 @@ rm COOJA.log
if [ $STATUS -eq 0 ] && [ $HOPS -eq $TARGETHOPS ] ; then if [ $STATUS -eq 0 ] && [ $HOPS -eq $TARGETHOPS ] ; then
printf "%-32s TEST OK\n" "$BASENAME" | tee $BASENAME.testlog; printf "%-32s TEST OK\n" "$BASENAME" | tee $BASENAME.testlog;
else else
# Verbose output when using CI echo "==== $BASENAME.coojalog ====" ; cat $BASENAME.coojalog;
if [ "$CI" = "true" ]; then echo "==== $BASENAME.tunslip.log ====" ; cat $BASENAME.tunslip.log;
echo "==== $BASENAME.coojalog ====" ; cat $BASENAME.coojalog; echo "==== $BASENAME.scriptlog ====" ; cat $BASENAME.scriptlog;
echo "==== $BASENAME.tunslip.log ====" ; cat $BASENAME.tunslip.log;
echo "==== $BASENAME.scriptlog ====" ; cat $BASENAME.scriptlog;
else
echo "==== Check $BASENAME.coojalog, $BASENAME.tunslip.log, and $BASENAME.scriptlog for details ====";
fi;
printf "%-32s TEST FAIL\n" "$BASENAME" | tee $BASENAME.testlog; printf "%-32s TEST FAIL\n" "$BASENAME" | tee $BASENAME.testlog;
fi fi

View File

@ -43,14 +43,9 @@ rm COOJA.log
if [ $STATUS -eq 0 ] ; then if [ $STATUS -eq 0 ] ; then
printf "%-32s TEST OK\n" "$BASENAME" | tee $BASENAME.testlog; printf "%-32s TEST OK\n" "$BASENAME" | tee $BASENAME.testlog;
else else
# Verbose output when using CI echo "==== $BASENAME.coojalog ====" ; cat $BASENAME.coojalog;
if [ "$CI" = "true" ]; then echo "==== $BASENAME.tunslip.log ====" ; cat $BASENAME.tunslip.log;
echo "==== $BASENAME.coojalog ====" ; cat $BASENAME.coojalog; echo "==== $BASENAME.scriptlog ====" ; cat $BASENAME.scriptlog;
echo "==== $BASENAME.tunslip.log ====" ; cat $BASENAME.tunslip.log;
echo "==== $BASENAME.scriptlog ====" ; cat $BASENAME.scriptlog;
else
echo "==== Check $BASENAME.coojalog, $BASENAME.tunslip.log, and $BASENAME.scriptlog for details ====";
fi;
printf "%-32s TEST FAIL\n" "$BASENAME" | tee $BASENAME.testlog; printf "%-32s TEST FAIL\n" "$BASENAME" | tee $BASENAME.testlog;
fi fi

View File

@ -29,28 +29,15 @@ pgrep hello-world | sudo xargs kill -9
if [ $STATUS -eq 0 ] ; then if [ $STATUS -eq 0 ] ; then
cp $BASENAME.log $BASENAME.testlog cp $BASENAME.log $BASENAME.testlog
printf "%-32s TEST OK\n" "$BASENAME" | tee -a $BASENAME.testlog; printf "%-32s TEST OK\n" "$BASENAME" | tee $BASENAME.testlog;
else else
mv $BASENAME.log $BASENAME.faillog echo "==== make.log ====" ; cat make.log;
echo "==== make.err ====" ; cat make.err;
echo "==== node.log ====" ; cat node.log;
echo "==== node.err ====" ; cat node.err;
echo "==== $BASENAME.log ====" ; cat $BASENAME.log;
echo "" printf "%-32s TEST FAIL\n" "$BASENAME" | tee $BASENAME.testlog;
echo "---- make.log"
cat make.log
echo ""
echo "---- make.err"
cat make.err
echo ""
echo "---- node.log"
cat node.log
echo ""
echo "---- node.err"
cat node.err
cp $BASENAME.log $BASENAME.faillog
printf "%-32s TEST FAIL\n" "$BASENAME" | tee -a $BASENAME.testlog;
fi fi
rm make.log rm make.log

View File

@ -3,16 +3,12 @@ TESTLOGS=$(sort $(patsubst %.sh,%.testlog,$(TESTS)))
CONTIKI=../.. CONTIKI=../..
tests: $(TESTLOGS) all: clean summary
summary: clean tests summary: cooja $(TESTLOGS)
ifeq ($(TESTS),) @cat *.testlog > summary
@echo No tests > $@ @echo "========== Summary =========="
else @cat summary
@cat $(TESTLOGS) > $@
endif
all: cooja clean tests
%.testlog: %.sh cooja %.testlog: %.sh cooja
@bash "$(basename $@).sh" "$(CONTIKI)" @bash "$(basename $@).sh" "$(CONTIKI)"