-testdir = $(srcdir)/test
-## It might be nice to configure testinstall and testbuild
-## directories, but for now they're hard-coded here and in the test
-## scripts.
-## And it would be easier to clean up if tests were launched from a
-## tmp directory, and/or each test cleaned up after itself on
-## successful completion.
-MOSTLYCLEANFILES = test/testinstall/*.actual* test/testinstall/*.expected* \
- test/testinstall/*.replgroupcomps test/testinstall/*.draft \
- test/testinstall/,*.draft* \*
+TESTS_ENVIRONMENT = MH_OBJ_DIR=@abs_builddir@ \
+ MH_TEST_DIR=@abs_builddir@/test/testdir \
+ auxexecdir=$(auxexecdir) bindir=$(bindir) \
+ mandir=$(mandir) sysconfdir=$(sysconfdir)
+##
+## Important note: the "cleanup" test should always be last
+##
+TESTS = test/bad-input/test-header test/comp/test-comp-format \
+ test/folder/test-create \
+ test/folder/test-total test/format/test-localmbox \
+ test/format/test-myname test/format/test-myhost \
+ test/format/test-mymbox \
+ test/inc/test-deb359167 test/inc/test-eom-align \
+ test/manpages/test-manpages test/mhbuild/test-forw \
+ test/mhpath/test-mhpath \
+ test/mhshow/test-cte-binary test/mhshow/test-qp \
+ test/mhshow/test-subpart test/new/test-basic test/pick/test-stderr \
+ test/repl/test-if-str test/scan/test-scan \
+ test/sequences/test-flist test/sequences/test-mark \
+ test/whatnow/test-attach-detach test/whatnow/test-cd \
+ test/whatnow/test-ls \
+ test/cleanup ## The "cleanup" test should always be last.
+
+check_SCRIPTS = test/common.sh
+check_PROGRAMS = test/getfullname