Re-work the test suite so it now works with Automake (via "make check").
[mmh] / test / whatnow / test-attach-detach
old mode 100644 (file)
new mode 100755 (executable)
similarity index 86%
rename from test/tests/whatnow/test-attach-detach
rename to test/whatnow/test-attach-detach
index 1a36d8d..4314553
@@ -6,6 +6,14 @@
 #
 ######################################################
 
+if [ -z "${MH_TEST_COMMON}" ]; then
+    echo "MH_TEST_COMMON not set; try running via 'make check'"
+fi
+
+. ${MH_TEST_COMMON}
+
+setup_test
+
 set -e
 
 cd "$MH_TEST_DIR"
@@ -34,5 +42,5 @@ echo "detach baz\\'s\\ boz" | whatnow -attach foo -noedit -prompt '' 2>> $actual
 echo "alist" | whatnow -attach foo -noedit -prompt '' 2>> $actualerr >> $actual
 set -e
 
-diff -u $expectederr $actualerr
+diff -u $expectederr $actualerr || exit 1
 diff -u $expected $actual