git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf: accommodate for MacOSX
@ 2016-06-18 13:03 Johannes Schindelin
  2016-06-19 16:56 ` Lars Schneider
  2016-06-21 13:53 ` [PATCH v2] " Johannes Schindelin
  0 siblings, 2 replies; 11+ messages in thread
From: Johannes Schindelin @ 2016-06-18 13:03 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

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 perf-lib.sh'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.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
Published-As: https://github.com/dscho/git/releases/tag/perf-macosx-v1

	This is another of those patches that came up in my rebase--helper
	work, even if it is not quite obvious from the patch ;-)

 .travis.yml        | 2 +-
 t/perf/perf-lib.sh | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index c20ec54..0e569bc 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -82,7 +82,7 @@ before_install:
       brew tap homebrew/binary --quiet
       brew_force_set_latest_binary_hash perforce
       brew_force_set_latest_binary_hash perforce-server
-      brew install git-lfs perforce-server perforce gettext
+      brew install git-lfs perforce-server perforce gettext gnu-time
       brew link --force gettext
       ;;
     esac;
diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh
index 18c363e..773f955 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
-- 
2.9.0.119.gb7b8d21

base-commit: 05219a1276341e72d8082d76b7f5ed394b7437a4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-06-21 18:39 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-18 13:03 [PATCH] perf: accommodate for MacOSX Johannes Schindelin
2016-06-19 16:56 ` Lars Schneider
2016-06-20  6:45   ` Johannes Schindelin
2016-06-20 19:48     ` Junio C Hamano
2016-06-21  7:57       ` Lars Schneider
2016-06-21 11:55         ` Johannes Schindelin
2016-06-21 12:49           ` Lars Schneider
2016-06-21 13:50             ` Johannes Schindelin
2016-06-21 13:53 ` [PATCH v2] " Johannes Schindelin
2016-06-21 18:03   ` Lars Schneider
2016-06-21 18:35     ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).