]> git.notmuchmail.org Git - notmuch/commitdiff
test: remove --root option and fix TMP_DIRECTORY cleanup
authorJani Nikula <jani@nikula.org>
Sat, 21 Oct 2017 11:58:02 +0000 (14:58 +0300)
committerDavid Bremner <david@tethera.net>
Sat, 21 Oct 2017 14:32:20 +0000 (11:32 -0300)
The primary motivation here is to fix TMP_DIRECTORY cleanup prior to
running each test when the current working directory is not the test
subdirectory. Tests with failures would leave their TMP_DIRECTORY
directory behind for debugging, and repeated out-of-tree test runs
would have old temp directories. (This lead to e.g. T310-emacs.sh
hanging because emacs would prompt for overwriting files.)

We remove the likely anyway defunct --root test option while at it,
just to be on the safe side when doing 'rm -rf' on the TMP_DIRECTORY.

test/README
test/test-lib-common.sh
test/test-lib.sh

index 8e06f44241a667609fdd5b47eda05b51e6fd3b47..b378c3ff3c5fa3a60b9758f52abd3c731d69ccfe 100644 (file)
@@ -80,15 +80,6 @@ The following command-line options are available when running tests:
        As the names depend on the tests' file names, it is safe to
        run the tests with this option in parallel.
 
        As the names depend on the tests' file names, it is safe to
        run the tests with this option in parallel.
 
---root=<dir>::
-       This runs the testsuites specified under a separate directory.
-       However, caution is advised, as not all tests are maintained
-       with this relocation in mind, so some tests may behave
-       differently.
-
-       Pointing this argument at a tmpfs filesystem can improve the
-       speed of the test suite for some users.
-
 Certain tests require precomputed databases to complete. You can fetch these
 databases with
 
 Certain tests require precomputed databases to complete. You can fetch these
 databases with
 
index 5e53348a943886c99926aa24b748a62b14aa9ba3..4300eb65418f1afa8d4cd93c3fd1d1a001b47ccf 100644 (file)
@@ -307,13 +307,9 @@ export PATH MANPATH
 
 # Test repository
 test="tmp.$(basename "$0" .sh)"
 
 # Test repository
 test="tmp.$(basename "$0" .sh)"
-test -n "$root" && test="$root/$test"
-case "$test" in
-/*) TMP_DIRECTORY="$test" ;;
- *) TMP_DIRECTORY="$TEST_DIRECTORY/$test" ;;
-esac
+TMP_DIRECTORY="$TEST_DIRECTORY/$test"
 test ! -z "$debug" || remove_tmp=$TMP_DIRECTORY
 test ! -z "$debug" || remove_tmp=$TMP_DIRECTORY
-rm -fr "$test" || {
+rm -rf "$TMP_DIRECTORY" || {
        GIT_EXIT_OK=t
        echo >&6 "FATAL: Cannot prepare test area"
        exit 1
        GIT_EXIT_OK=t
        echo >&6 "FATAL: Cannot prepare test area"
        exit 1
index 4619c327dd024d95b9054dccb307262156ea5f24..7926d27877102a0bc7a528dc40ec0438cf01d1f9 100644 (file)
@@ -160,9 +160,6 @@ do
                valgrind=t; verbose=t; shift ;;
        --tee)
                shift ;; # was handled already
                valgrind=t; verbose=t; shift ;;
        --tee)
                shift ;; # was handled already
-       --root=*)
-               root=$(expr "z$1" : 'z[^=]*=\(.*\)')
-               shift ;;
        *)
                echo "error: unknown test option '$1'" >&2; exit 1 ;;
        esac
        *)
                echo "error: unknown test option '$1'" >&2; exit 1 ;;
        esac