summaryrefslogtreecommitdiffstats
path: root/menu/tests
diff options
context:
space:
mode:
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