Here's the proper fix instead of the hack of d28ce569fe233141f86fe516878361da01c9f9cb...
[mmh] / test / mhbuild / test-forw
index c92242f..5369f22 100755 (executable)
@@ -5,23 +5,15 @@
 #
 ######################################################
 
-if [ -z "${MH_TEST_COMMON}" ]; then
-    echo "MH_TEST_COMMON not set; try running via 'make check'"
+if test -z "${MH_OBJ_DIR}"; then
+    srcdir=`dirname $0`/../..
+    MH_OBJ_DIR=`cd $srcdir && pwd`; export MH_OBJ_DIR
 fi
 
-. ${MH_TEST_COMMON}
+. "$MH_OBJ_DIR/test/common.sh"
 
 setup_test
 
-# TODO: Move to a common file tests can source; need more framework...
-failed=0
-check() {
-    diff -u $expected $actual
-    if [ $? -ne 0 ]; then
-        failed=$((failed + 1))
-    fi
-}
-
 # Make a draft file forwarding two messages.
 mkdraft() {
     cat > $draft <<EOF
@@ -80,7 +72,7 @@ EOF
 mkdraft
 mhbuild $draft
 mungedraft
-check
+check $expected $actual
 
 # check mhbuild -rfc934
 cat > $expected <<EOF
@@ -117,6 +109,6 @@ EOF
 mkdraft
 mhbuild -rfc934 $draft
 mungedraft
-check
+check $expected $actual
 
 exit $failed