@@ -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
@@ -143,10 +144,16 @@ test_expect_success "one time repo setup" '
143
144
144
145
setup_for_fsmonitor () {
145
146
# set INTEGRATION_SCRIPT depending on the environment
146
- if test -n " $INTEGRATION_PATH "
147
+ if test -n " $USE_FSMONITOR_DAEMON "
147
148
then
149
+ git config core.useBuiltinFSMonitor true &&
150
+ INTEGRATION_SCRIPT=false
151
+ elif test -n " $INTEGRATION_PATH "
152
+ then
153
+ git config core.useBuiltinFSMonitor false &&
148
154
INTEGRATION_SCRIPT=" $INTEGRATION_PATH "
149
155
else
156
+ git config core.useBuiltinFSMonitor false &&
150
157
#
151
158
# Choose integration script based on existence of Watchman.
152
159
# Fall back to an empty integration script.
@@ -182,7 +189,10 @@ test_perf_w_drop_caches () {
182
189
}
183
190
184
191
test_fsmonitor_suite () {
185
- if test -n " $INTEGRATION_SCRIPT " ; then
192
+ if test -n " $USE_FSMONITOR_DAEMON "
193
+ then
194
+ DESC=" builtin fsmonitor--daemon"
195
+ elif test -n " $INTEGRATION_SCRIPT " ; then
186
196
DESC=" fsmonitor=$( basename $INTEGRATION_SCRIPT ) "
187
197
else
188
198
DESC=" fsmonitor=disabled"
@@ -293,4 +303,25 @@ test_expect_success "setup without fsmonitor" '
293
303
test_fsmonitor_suite
294
304
trace_stop
295
305
306
+ #
307
+ # Run a full set of perf tests using the built-in fsmonitor--daemon.
308
+ # It does not use the Hook API, so it has a different setup.
309
+ # Explicitly start the daemon here and before we start client commands
310
+ # so that we can later add custom tracing.
311
+ #
312
+ if test_have_prereq FSMONITOR_DAEMON
313
+ then
314
+ USE_FSMONITOR_DAEMON=t
315
+
316
+ trace_start fsmonitor--daemon--server
317
+ git fsmonitor--daemon start
318
+
319
+ trace_start fsmonitor--daemon--client
320
+ test_expect_success " setup for fsmonitor--daemon" ' setup_for_fsmonitor'
321
+ test_fsmonitor_suite
322
+
323
+ git fsmonitor--daemon stop
324
+ trace_stop
325
+ fi
326
+
296
327
test_done
0 commit comments