@@ -24,7 +24,8 @@ test_description="Test core.fsmonitor"
24
24
# GIT_PERF_7519_SPLIT_INDEX: used to configure core.splitIndex
25
25
# GIT_PERF_7519_FSMONITOR: used to configure core.fsMonitor. May be an
26
26
# absolute path to an integration. May be a space delimited list of
27
- # absolute paths to integrations.
27
+ # absolute paths to integrations. (This hook or list of hooks does not
28
+ # include the built-in fsmonitor--daemon.)
28
29
#
29
30
# The big win for using fsmonitor is the elimination of the need to scan the
30
31
# working directory looking for changed and untracked files. If the file
@@ -135,10 +136,16 @@ test_expect_success "one time repo setup" '
135
136
136
137
setup_for_fsmonitor () {
137
138
# set INTEGRATION_SCRIPT depending on the environment
138
- if test -n " $INTEGRATION_PATH "
139
+ if test -n " $USE_FSMONITOR_DAEMON "
139
140
then
141
+ git config core.useBuiltinFSMonitor true &&
142
+ INTEGRATION_SCRIPT=false
143
+ elif test -n " $INTEGRATION_PATH "
144
+ then
145
+ git config core.useBuiltinFSMonitor false &&
140
146
INTEGRATION_SCRIPT=" $INTEGRATION_PATH "
141
147
else
148
+ git config core.useBuiltinFSMonitor false &&
142
149
#
143
150
# Choose integration script based on existence of Watchman.
144
151
# Fall back to an empty integration script.
@@ -281,4 +288,30 @@ test_expect_success "setup without fsmonitor" '
281
288
test_fsmonitor_suite
282
289
trace_stop
283
290
291
+ #
292
+ # Run a full set of perf tests using the built-in fsmonitor--daemon.
293
+ # It does not use the Hook API, so it has a different setup.
294
+ # Explicitly start the daemon here and before we start client commands
295
+ # so that we can later add custom tracing.
296
+ #
297
+
298
+ test_lazy_prereq HAVE_FSMONITOR_DAEMON '
299
+ git version --build-options | grep "feature:" | grep "fsmonitor--daemon"
300
+ '
301
+
302
+ if test_have_prereq HAVE_FSMONITOR_DAEMON
303
+ then
304
+ USE_FSMONITOR_DAEMON=t
305
+
306
+ trace_start fsmonitor--daemon--server
307
+ git fsmonitor--daemon --start
308
+
309
+ trace_start fsmonitor--daemon--client
310
+ test_expect_success " setup for fsmonitor--daemon" ' setup_for_fsmonitor'
311
+ test_fsmonitor_suite
312
+
313
+ git fsmonitor--daemon --stop
314
+ trace_stop
315
+ fi
316
+
284
317
test_done
0 commit comments