aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xt/perf/p0000-perf-lib-sanity.sh11
-rw-r--r--t/perf/perf-lib.sh4
2 files changed, 14 insertions, 1 deletions
diff --git a/t/perf/p0000-perf-lib-sanity.sh b/t/perf/p0000-perf-lib-sanity.sh
index f8dd53670..cf8e1efce 100755
--- a/t/perf/p0000-perf-lib-sanity.sh
+++ b/t/perf/p0000-perf-lib-sanity.sh
@@ -38,9 +38,18 @@ test_expect_success 'test_export works with weird vars' '
test "$bar" = "weird # variable"
'
+test_perf 'important variables available in subshells' '
+ test -n "$HOME" &&
+ test -n "$TEST_DIRECTORY" &&
+ test -n "$TRASH_DIRECTORY" &&
+ test -n "$GIT_BUILD_DIR"
+'
+
test_perf 'test-lib-functions correctly loaded in subshells' '
: >a &&
- test_path_is_file a
+ test_path_is_file a &&
+ : >b &&
+ test_cmp a b
'
test_done
diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh
index bcc013164..5580c2281 100644
--- a/t/perf/perf-lib.sh
+++ b/t/perf/perf-lib.sh
@@ -45,6 +45,10 @@ TEST_NO_CREATE_REPO=t
. ../test-lib.sh
+# Variables from test-lib that are normally internal to the tests; we
+# need to export them for test_perf subshells
+export TEST_DIRECTORY TRASH_DIRECTORY GIT_BUILD_DIR GIT_TEST_CMP
+
perf_results_dir=$TEST_OUTPUT_DIRECTORY/test-results
mkdir -p "$perf_results_dir"
rm -f "$perf_results_dir"/$(basename "$0" .sh).subtests