aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-07-06 13:38:16 -0700
committerJunio C Hamano <gitster@pobox.com>2016-07-06 13:38:16 -0700
commit3437017fecf7198516bc17e458aab4909e24c7f0 (patch)
tree69af607606dfcaea5437d4b86e7251d6037b5cf7
parent3edaee74fdd804035d5f59c35c50ef05779fb73b (diff)
parente3efa94be985c398b2118c3c7f7f9bfe3d056687 (diff)
downloadgit-3437017fecf7198516bc17e458aab4909e24c7f0.tar.gz
git-3437017fecf7198516bc17e458aab4909e24c7f0.tar.xz
Merge branch 'js/perf-on-apple'
t/perf needs /usr/bin/time with GNU extension; the invocation of it is updated to "gtime" on Darwin. * js/perf-on-apple: perf: accommodate for MacOSX
-rw-r--r--.travis.yml2
-rw-r--r--t/perf/perf-lib.sh6
2 files changed, 7 insertions, 1 deletions
diff --git a/.travis.yml b/.travis.yml
index c20ec540c..c2b76f9b7 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -82,6 +82,8 @@ before_install:
brew tap homebrew/binary --quiet
brew_force_set_latest_binary_hash perforce
brew_force_set_latest_binary_hash perforce-server
+ # Uncomment this if you want to run perf tests:
+ # brew install gnu-time
brew install git-lfs perforce-server perforce gettext
brew link --force gettext
;;
diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh
index 18c363ea7..773f955d4 100644
--- a/t/perf/perf-lib.sh
+++ b/t/perf/perf-lib.sh
@@ -127,11 +127,15 @@ test_checkout_worktree () {
# Performance tests should never fail. If they do, stop immediately
immediate=t
+# Perf tests require GNU time
+case "$(uname -s)" in Darwin) GTIME="${GTIME:-gtime}";; esac
+GTIME="${GTIME:-/usr/bin/time}"
+
test_run_perf_ () {
test_cleanup=:
test_export_="test_cleanup"
export test_cleanup test_export_
- /usr/bin/time -f "%E %U %S" -o test_time.$i "$SHELL" -c '
+ "$GTIME" -f "%E %U %S" -o test_time.$i "$SHELL" -c '
. '"$TEST_DIRECTORY"/test-lib-functions.sh'
test_export () {
[ $# != 0 ] || return 0