t/perf/fsmonitor: factor setup for fsmonitor into function

This prepares for it being called multiple times when testing different hooks Signed-off-by: Nipunn Koorapati <nipunn@dropbox.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Nipunn Koorapati committed Oct 26, 2020 at 19:32 UTC a05b71ab91502db5e1234bc7aaf837bf49564c90
1 file changed +6 -2
t/perf/p7519-fsmonitor.sh
+6 -2
@@ -103,7 +103,7 @@ test_expect_success "one time repo setup" '
103 fi
104 '
105
106 -test_expect_success "setup for fsmonitor" '
106 +setup_for_fsmonitor() {
107 # set INTEGRATION_SCRIPT depending on the environment
108 if test -n "$GIT_PERF_7519_FSMONITOR"
109 then
@@ -130,7 +130,7 @@ test_expect_success "setup for fsmonitor" '
130 cat error &&
131 [ ! -s error ] && # ensure no silent error
132 git status # Warm caches
133 -'
133 +}
134
135 test_perf_w_drop_caches () {
136 if test -n "$GIT_PERF_7519_DROP_CACHE"; then
@@ -188,6 +188,10 @@ test_fsmonitor_suite() {
188 '
189 }
190
191 +test_expect_success "setup for fsmonitor" '
192 + setup_for_fsmonitor
193 +'
194 +
195 test_fsmonitor_suite
196
197 test_expect_success "setup without fsmonitor" '