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
printf "%-32s TEST OK\n" "$BASENAME" | tee $BASENAME.testlog;
else
# Verbose output when using CI
if [ "$CI" = "true" ]; then
echo "==== $BASENAME.coojalog ====" ; cat $BASENAME.coojalog;
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;
echo "==== $BASENAME.coojalog ====" ; cat $BASENAME.coojalog;
echo "==== $BASENAME.tunslip.log ====" ; cat $BASENAME.tunslip.log;
echo "==== $BASENAME.scriptlog ====" ; cat $BASENAME.scriptlog;
printf "%-32s TEST FAIL\n" "$BASENAME" | tee $BASENAME.testlog;
fi

View File

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

View File

@ -29,28 +29,15 @@ pgrep hello-world | sudo xargs kill -9
if [ $STATUS -eq 0 ] ; then
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
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 ""
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;
printf "%-32s TEST FAIL\n" "$BASENAME" | tee $BASENAME.testlog;
fi
rm make.log

View File

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