Skip to content

Commit e1ecd9e

Browse files
committed
test: turn USR_BIN_TIME into a lazy prerequisite
Two test scripts (t3302 and t3419) had copy & paste code to set USR_BIN_TIME prerequisite. Use the test_lazy_prereq helper to define them in the common t/test-lib.sh. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6219bb2 commit e1ecd9e

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

t/t3302-notes-index-expensive.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ test_description='Test commit notes index (expensive!)'
99

1010
test_set_prereq NOT_EXPENSIVE
1111
test -n "$GIT_NOTES_TIMING_TESTS" && test_set_prereq EXPENSIVE
12-
test -x /usr/bin/time && test_set_prereq USR_BIN_TIME
1312

1413
create_repo () {
1514
number_of_commits=$1

t/t3419-rebase-patch-id.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ test_description='git rebase - test patch id computation'
66

77
test_set_prereq NOT_EXPENSIVE
88
test -n "$GIT_PATCHID_TIMING_TESTS" && test_set_prereq EXPENSIVE
9-
test -x /usr/bin/time && test_set_prereq USR_BIN_TIME
109

1110
count()
1211
{

t/test-lib.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,10 @@ test_lazy_prereq EXPENSIVE '
859859
test -n "$GIT_TEST_LONG"
860860
'
861861

862+
test_lazy_prereq USR_BIN_TIME '
863+
test -x /usr/bin/time
864+
'
865+
862866
# When the tests are run as root, permission tests will report that
863867
# things are writable when they shouldn't be.
864868
test -w / || test_set_prereq SANITY

0 commit comments

Comments
 (0)