tests: When running local tests with run_tests.sh, use fixed TEST_VAR_DIR
authorMartin Schwenke <martin@meltin.net>
Fri, 11 Oct 2013 04:05:54 +0000 (15:05 +1100)
committerMartin Schwenke <martin@meltin.net>
Tue, 22 Oct 2013 02:07:13 +0000 (13:07 +1100)
Otherwise we end up with lots of useless temporary directories.

Signed-off-by: Martin Schwenke <martin@meltin.net>
tests/run_tests.sh

index 4ab443f671c4172c10050abfe981067c79d1cd08..5fcd89d5dee9e76799bb9195c0f0a80be5305cd5 100755 (executable)
@@ -16,6 +16,12 @@ case $(basename "$0") in
        # * default to running: all unit tests, simple integration tests
        opts="-s -l"
        tests="onnode takeover tool eventscripts simple"
+       # If running in the source tree then use a fixed TEST_VAR_DIR.
+       # If this script is installed using the INSTALL script then
+       # TEST_BIN_DIR will be set, so use this as the test.
+       if [ -z "$TEST_BIN_DIR" ] ; then
+           opts="${opts} -V ${test_dir}/var"
+       fi
 esac
 
 # Allow options to be passed to this script.  However, if any options