Browse Source

Merge branch 'js/perf-on-apple' into maint

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
maint
Junio C Hamano 9 years ago
parent
commit
ce22ea22e8
  1. 2
      .travis.yml
  2. 6
      t/perf/perf-lib.sh

2
.travis.yml

@ -82,6 +82,8 @@ before_install: @@ -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
;;

6
t/perf/perf-lib.sh

@ -127,11 +127,15 @@ test_checkout_worktree () { @@ -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

Loading…
Cancel
Save