Re: [PATCH v3 10/34] t/helper/fsmonitor-client: create IPC client to talk to FSMonitor Daemon
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Jul 1, 2021, 22:41 UTC
- Message-ID
- <87y2apbqqk.fsf@evledraar.gmail.com>
- In-Reply-To
- <c2adac8ed4b4f324b54b147e1fcb1aa4a74e80dd.1625150864.git.gitgitgadget@gmail.com>
On Thu, Jul 01 2021, Jeff Hostetler via GitGitGadget wrote:
Show 47 quoted lines
> From: Jeff Hostetler <jeffhost@microsoft.com>
>
> Create an IPC client to send query and flush commands to the daemon.
>
> Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
> ---
> Makefile | 1 +
> t/helper/test-fsmonitor-client.c | 121 +++++++++++++++++++++++++++++++
> t/helper/test-tool.c | 1 +
> t/helper/test-tool.h | 1 +
> 4 files changed, 124 insertions(+)
> create mode 100644 t/helper/test-fsmonitor-client.c
>
> diff --git a/Makefile b/Makefile
> index 8fe1e42a435..c45caacf2c3 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -709,6 +709,7 @@ TEST_BUILTINS_OBJS += test-dump-split-index.o
> TEST_BUILTINS_OBJS += test-dump-untracked-cache.o
> TEST_BUILTINS_OBJS += test-example-decorate.o
> TEST_BUILTINS_OBJS += test-fast-rebase.o
> +TEST_BUILTINS_OBJS += test-fsmonitor-client.o
> TEST_BUILTINS_OBJS += test-genrandom.o
> TEST_BUILTINS_OBJS += test-genzeros.o
> TEST_BUILTINS_OBJS += test-hash-speed.o
> diff --git a/t/helper/test-fsmonitor-client.c b/t/helper/test-fsmonitor-client.c
> new file mode 100644
> index 00000000000..f7a5b3a32fa
> --- /dev/null
> +++ b/t/helper/test-fsmonitor-client.c
> @@ -0,0 +1,121 @@
> +/*
> + * test-fsmonitor-client.c: client code to send commands/requests to
> + * a `git fsmonitor--daemon` daemon.
> + */
> +
> +#include "test-tool.h"
> +#include "cache.h"
> +#include "parse-options.h"
> +#include "fsmonitor-ipc.h"
> +
> +#ifndef HAVE_FSMONITOR_DAEMON_BACKEND
> +int cmd__fsmonitor_client(int argc, const char **argv)
> +{
> + die("fsmonitor--daemon not available on this platform");
> +}
> +#elseRe my earlier comments on excessive ifdefs: In this case don't we just want to not compile test-fsmonitor-client at all unless HAVE_FSMONITOR_DAEMON_BACKEND is true.
You'll get the same error as though you ran "helper/test-tool does-not-exist", but the tests check for the prerequisite earlier anyway, so why get this far on an unsupported platform for a pure test helper?