@@ -141,7 +141,7 @@ test_expect_success "one time repo setup" '
141141 fi
142142'
143143
144- setup_for_fsmonitor () {
144+ setup_for_fsmonitor_hook () {
145145 # set INTEGRATION_SCRIPT depending on the environment
146146 if test -n " $INTEGRATION_PATH "
147147 then
@@ -182,7 +182,11 @@ test_perf_w_drop_caches () {
182182}
183183
184184test_fsmonitor_suite () {
185- if test -n " $INTEGRATION_SCRIPT " ; then
185+ if test -n " $USE_FSMONITOR_DAEMON "
186+ then
187+ DESC=" builtin fsmonitor--daemon"
188+ elif test -n " $INTEGRATION_SCRIPT "
189+ then
186190 DESC=" fsmonitor=$( basename $INTEGRATION_SCRIPT ) "
187191 else
188192 DESC=" fsmonitor=disabled"
@@ -261,11 +265,11 @@ test_fsmonitor_suite () {
261265trace_start fsmonitor-watchman
262266if test -n " $GIT_PERF_7519_FSMONITOR " ; then
263267 for INTEGRATION_PATH in $GIT_PERF_7519_FSMONITOR ; do
264- test_expect_success " setup for fsmonitor $INTEGRATION_PATH " ' setup_for_fsmonitor '
268+ test_expect_success " setup for fsmonitor $INTEGRATION_PATH " ' setup_for_fsmonitor_hook '
265269 test_fsmonitor_suite
266270 done
267271else
268- test_expect_success " setup for fsmonitor" ' setup_for_fsmonitor '
272+ test_expect_success " setup for fsmonitor hook " ' setup_for_fsmonitor_hook '
269273 test_fsmonitor_suite
270274fi
271275
@@ -293,4 +297,30 @@ test_expect_success "setup without fsmonitor" '
293297test_fsmonitor_suite
294298trace_stop
295299
300+ #
301+ # Run a full set of perf tests using the built-in fsmonitor--daemon.
302+ # It does not use the Hook API, so it has a different setup.
303+ # Explicitly start the daemon here and before we start client commands
304+ # so that we can later add custom tracing.
305+ #
306+ if test_have_prereq FSMONITOR_DAEMON
307+ then
308+ USE_FSMONITOR_DAEMON=t
309+
310+ test_expect_success " setup for builtin fsmonitor" '
311+ trace_start fsmonitor--daemon--server &&
312+ git fsmonitor--daemon start &&
313+
314+ trace_start fsmonitor--daemon--client &&
315+
316+ git config core.fsmonitor true &&
317+ git update-index --fsmonitor
318+ '
319+
320+ test_fsmonitor_suite
321+
322+ git fsmonitor--daemon stop
323+ trace_stop
324+ fi
325+
296326test_done
0 commit comments