summaryrefslogtreecommitdiffstats
path: root/menu/tests
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-10-16 20:27:51 +0000
committerHavoc Pennington <hp@pobox.com>2003-10-16 20:27:51 +0000
commit5958cf9336feeee9ecb5da8671a4663c1e5bffc5 (patch)
treee1e7cc5048ce83b8fd2d584d37bd8b0c27adf54e /menu/tests
parentca5436d69473b49cf7efc3b9217249fc41675950 (diff)
downloadxdg-specs-5958cf9336feeee9ecb5da8671a4663c1e5bffc5.tar.xz
cat log file on failure; print list of failed tests when we're done
2003-10-16 Havoc Pennington <hp@redhat.com> * menutest: cat log file on failure; print list of failed tests when we're done
Diffstat (limited to 'menu/tests')
-rw-r--r--menu/tests/ChangeLog5
-rwxr-xr-xmenu/tests/menutest15
2 files changed, 20 insertions, 0 deletions
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 <hp@redhat.com>
+
+ * 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