Skip to content

Commit

Permalink
t3302: do not chdir around in the primary test process
Browse files Browse the repository at this point in the history
These days^Wyears we strive to do stuff in subdirectories inside
subshells to avoid mistakes.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Jun 9, 2014
1 parent ac2803b commit f23b1d0
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions t/t3302-notes-index-expensive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,27 @@ do_tests () {
pr=$1
count=$2

test_expect_success $pr 'setup / mkdir' '
mkdir $count &&
cd $count
test_expect_success $pr "setup $count" '
mkdir "$count" &&
(
cd "$count" &&
create_repo "$count"
)
'

test_expect_success $pr "setup $count" "create_repo $count"

test_expect_success $pr 'notes work' "test_notes $count"

test_expect_success USR_BIN_TIME,$pr 'notes timing with /usr/bin/time' "time_notes 100"
test_expect_success $pr 'notes work' '
(
cd "$count" &&
test_notes "$count"
)
'

test_expect_success $pr 'teardown / cd ..' 'cd ..'
test_expect_success USR_BIN_TIME,$pr 'notes timing with /usr/bin/time' '
(
cd "$count" &&
time_notes 100
)
'
}

do_tests NOT_EXPENSIVE 10
Expand Down

0 comments on commit f23b1d0

Please sign in to comment.