Skip to content

Commit

Permalink
Merge pull request #605 from chameco/summarize-inttests
Browse files Browse the repository at this point in the history
Print a brief summary of integration test results
  • Loading branch information
brianhuffman authored Dec 6, 2019
2 parents 52b14b5 + 76142f3 commit d8a2886
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion intTests/runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ rm -f logs/*

NUM_TESTS=0
FAILED_TESTS=0
FAILED_TEST_DETAILS="failed:"
export TIMEFORMAT="%R"
TOTAL_TIME=0

Expand Down Expand Up @@ -122,6 +123,7 @@ for i in $TESTS; do
echo "$i: FAIL (${TEST_TIME}s${TIMED_OUT})"
if [ ! -z "$LOUD" ]; then cat logs/$i.log; fi
FAILED_TESTS=$(( $FAILED_TESTS + 1 ))
FAILED_TEST_DETAILS+=" $i"
echo " <testcase name=\"${i}\" time=\"${TEST_TIME}\"><failure><![CDATA[" >> ${XML_TEMP}
sed -e 's/]]>/] ]>/' logs/$i.log >> ${XML_TEMP}
echo "]]></failure></testcase>" >> ${XML_TEMP}
Expand All @@ -136,4 +138,10 @@ echo " </testsuite>" >> $XML_FILE
echo "</testsuites>" >> $XML_FILE
rm $XML_TEMP

echo "tests completed"
PASSED_TESTS=$(expr $NUM_TESTS - $FAILED_TESTS)
echo "tests passed: ${PASSED_TESTS} / ${NUM_TESTS}"
if [ "${FAILED_TESTS}" == 0 ]; then
echo "all tests passed"
else
echo "${FAILED_TEST_DETAILS}"
fi

0 comments on commit d8a2886

Please sign in to comment.