path: root/t/perf/
diff options
authorJohannes Schindelin <>2016-06-21 13:53:43 (GMT)
committerJunio C Hamano <>2016-06-21 18:18:17 (GMT)
commite3efa94be985c398b2118c3c7f7f9bfe3d056687 (patch)
treec7d03554c39981c2714fca36d87ddf50cd3fdd35 /t/perf/
parent05219a1276341e72d8082d76b7f5ed394b7437a4 (diff)
perf: accommodate for MacOSX
As this developer has no access to MacOSX developer setups anymore, Travis becomes the best bet to run performance tests on that OS. However, on MacOSX /usr/bin/time is that good old BSD executable that no Linux user cares about, as demonstrated by the's use of GNU-ish extensions. And by the hard-coded path. Let's just work around this issue by using gtime on MacOSX, the Homebrew-provided GNU implementation onto which pretty much every MacOSX power user falls back anyway. To help other developers use Travis to run performance tests on MacOSX, the .travis.yml file now sports a commented-out line that installs GNU time via Homebrew. Signed-off-by: Johannes Schindelin <> Reviewed-by: Lars Schneider <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 't/perf/')
1 files changed, 5 insertions, 1 deletions
diff --git a/t/perf/ b/t/perf/
index 18c363e..773f955 100644
--- a/t/perf/
+++ b/t/perf/
@@ -127,11 +127,15 @@ test_checkout_worktree () {
# Performance tests should never fail. If they do, stop immediately
+# Perf tests require GNU time
+case "$(uname -s)" in Darwin) GTIME="${GTIME:-gtime}";; esac
test_run_perf_ () {
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_export () {
[ $# != 0 ] || return 0