Re-work the test suite so it now works with Automake (via "make check").
[mmh] / test / whatnow / test-cd
old mode 100644 (file)
new mode 100755 (executable)
similarity index 81%
rename from test/tests/whatnow/test-cd
rename to test/whatnow/test-cd
index 3e0ddc4..d92f334
@@ -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"
@@ -30,5 +38,5 @@ EOF
 # watch the quoting -- shell and printf and then the shell run inside whatnow
 printf "cd $MH_TEST_DIR/foo\\\\'s\\\\ bar\npwd\n" | whatnow -noedit -prompt '' 2> "$actualerr" > "$actual" || true
 
-diff -u $expectederr $actualerr
+diff -u $expectederr $actualerr || exit 1
 diff -u $expected $actual