summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1cbc324)
raw | patch | inline | side by side (parent: 1cbc324)
author | Thomas Rast <trast@student.ethz.ch> | |
Thu, 8 Mar 2012 08:54:55 +0000 (09:54 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 8 Mar 2012 20:07:50 +0000 (12:07 -0800) |
The only bug right now is that $GIT_TEST_CMP is needed for test_cmp to
work.
However, we also export the three most important paths for tests:
TEST_DIRECTORY
TRASH_DIRECTORY
GIT_BUILD_DIR
Since they are available within test_expect_success, a future test
writer may expect them to also be defined in test_perf.
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
work.
However, we also export the three most important paths for tests:
TEST_DIRECTORY
TRASH_DIRECTORY
GIT_BUILD_DIR
Since they are available within test_expect_success, a future test
writer may expect them to also be defined in test_perf.
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/perf/p0000-perf-lib-sanity.sh | patch | blob | history | |
t/perf/perf-lib.sh | patch | blob | history |
index f8dd53670950089c6e982110b42dd79115b54607..cf8e1efce7cd29679c3ffdb2fa7d03489c38c1c9 100755 (executable)
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 bcc0131646aa1b36e13fc47817989e3985aec1c2..5580c22812be1cadd6b70974eb85ce7cda1b8df3 100644 (file)
--- a/t/perf/perf-lib.sh
+++ b/t/perf/perf-lib.sh
. ../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