From 5958cf9336feeee9ecb5da8671a4663c1e5bffc5 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Thu, 16 Oct 2003 20:27:51 +0000 Subject: cat log file on failure; print list of failed tests when we're done 2003-10-16 Havoc Pennington * menutest: cat log file on failure; print list of failed tests when we're done --- menu/tests/ChangeLog | 5 +++++ menu/tests/menutest | 15 +++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 menu/tests/ChangeLog diff --git a/menu/tests/ChangeLog b/menu/tests/ChangeLog new file mode 100644 index 0000000..86654fc --- /dev/null +++ b/menu/tests/ChangeLog @@ -0,0 +1,5 @@ +2003-10-16 Havoc Pennington + + * menutest: cat log file on failure; print list of failed tests + when we're done + diff --git a/menu/tests/menutest b/menu/tests/menutest index c5eb4aa..d164f26 100755 --- a/menu/tests/menutest +++ b/menu/tests/menutest @@ -28,6 +28,8 @@ if [ "x${TESTS}" == "x" ]; then TESTS=`ls tests` fi +FAILED= +SUCCEEDED= for TEST in ${TESTS}; do echo rm -rf ${MENUTESTDIR} 2> /dev/null @@ -63,15 +65,28 @@ for TEST in ${TESTS}; do if diff -q ${MENUTESTDIR}/result1 ${MENUTESTDIR}/result2 > /dev/null; then echo '>>> OK' + SUCCEEDED="${SUCCEEDED} ${TEST}" else sort ${MENUTESTDIR}/result1 > ${MENUTESTDIR}/result1.sorted sort ${MENUTESTDIR}/result2 > ${MENUTESTDIR}/result2.sorted if diff -u ${MENUTESTDIR}/result1.sorted ${MENUTESTDIR}/result2.sorted > ${MENUTESTDIR}/result.diff; then echo '>>> OK (different order)' + SUCCEEDED="${SUCCEEDED} ${TEST}" else echo '>>> Failed' cat ${MENUTESTDIR}/result.diff + cat ${MENUTESTDIR}/log + FAILED="${FAILED} ${TEST}" fi fi fi done + +echo "OK tests: ${SUCCEEDED}" + +if ! test -z "${FAILED}" ; then + echo "Failed tests: ${FAILED}" + exit 1 +fi + +exit 0 -- cgit v1.2.3-70-g09d2