summaryrefslogtreecommitdiff
path: root/t/perf
diff options
context:
space:
mode:
authorJiang Xin <worldhello.net@gmail.com>2012-03-16 12:18:07 (GMT)
committerJiang Xin <worldhello.net@gmail.com>2012-03-16 12:18:07 (GMT)
commitd90b16ed421eb51fc4d7c6bda5f3332cc2e3aece (patch)
tree2d90d25ecbe794492f0fb267f31af8a1f646327d /t/perf
parent6672dc8e694f412090417a95cd6cd4b2b5be6da1 (diff)
parent0e2d57fd50f61e668be3180bc8f25991ea88aa8c (diff)
downloadgit-d90b16ed421eb51fc4d7c6bda5f3332cc2e3aece.zip
git-d90b16ed421eb51fc4d7c6bda5f3332cc2e3aece.tar.gz
git-d90b16ed421eb51fc4d7c6bda5f3332cc2e3aece.tar.bz2
Merge v1.7.10-rc0 for git l10n update
Diffstat (limited to 't/perf')
-rwxr-xr-xt/perf/p0000-perf-lib-sanity.sh14
-rwxr-xr-xt/perf/p4000-diff-algorithms.sh2
-rw-r--r--t/perf/perf-lib.sh6
3 files changed, 20 insertions, 2 deletions
diff --git a/t/perf/p0000-perf-lib-sanity.sh b/t/perf/p0000-perf-lib-sanity.sh
index 2ca4aac..cf8e1ef 100755
--- a/t/perf/p0000-perf-lib-sanity.sh
+++ b/t/perf/p0000-perf-lib-sanity.sh
@@ -38,4 +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 &&
+ : >b &&
+ test_cmp a b
+'
+
test_done
diff --git a/t/perf/p4000-diff-algorithms.sh b/t/perf/p4000-diff-algorithms.sh
index d6e505c..7e00c9d 100755
--- a/t/perf/p4000-diff-algorithms.sh
+++ b/t/perf/p4000-diff-algorithms.sh
@@ -7,7 +7,7 @@ test_description="Tests diff generation performance"
test_perf_default_repo
test_perf 'log -3000 (baseline)' '
- git log -1000 >/dev/null
+ git log -3000 >/dev/null
'
test_perf 'log --raw -3000 (tree-only)' '
diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh
index 2a5e1f3..5580c22 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
@@ -119,7 +123,7 @@ test_run_perf_ () {
test_export_="test_cleanup"
export test_cleanup test_export_
/usr/bin/time -f "%E %U %S" -o test_time.$i "$SHELL" -c '
-. '"$TEST_DIRECTORY"/../test-lib-functions.sh'
+. '"$TEST_DIRECTORY"/test-lib-functions.sh'
test_export () {
[ $# != 0 ] || return 0
test_export_="$test_export_\\|$1"