Re-work the test suite so it now works with Automake (via "make check").
[mmh] / test / whatnow / test-ls
old mode 100644 (file)
new mode 100755 (executable)
similarity index 79%
rename from test/tests/whatnow/test-ls
rename to test/whatnow/test-ls
index e0dc969..58ee2f6
@@ -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
 SPDIR="$MH_TEST_DIR/foo's bar"
 rm -rf "$SPDIR"
@@ -29,5 +37,5 @@ EOF
 # NB use of sort as the order of output of ls is not guaranteed
 echo 'ls' | whatnow -noedit -prompt '' 2> "$actualerr" | sort > "$actual"
 
-diff -u $expectederr $actualerr
+diff -u $expectederr $actualerr || exit 1
 diff -u $expected $actual