Skip to content

Commit 8e8fac9

Browse files
committed
Skip POSIX-only CLI path lookup tests on Windows
cli_find_cli_on_path and cli_find_cli_fallback_paths use /tmp paths and #!/bin/sh shebangs that don't work on MSYS2/Windows.
1 parent 25d94d8 commit 8e8fac9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/test_cli.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,10 @@ TEST(cli_find_cli_on_path) {
331331
write_test_file(fakecli, "#!/bin/sh\n");
332332
th_make_executable(fakecli);
333333

334+
#ifdef _WIN32
335+
rmdir(tmpdir);
336+
SKIP("PATH-based CLI lookup uses POSIX semantics");
337+
#endif
334338
const char *raw = getenv("PATH");
335339
char *old_path = raw ? strdup(raw) : NULL;
336340
cbm_setenv("PATH", tmpdir, 1);
@@ -355,6 +359,10 @@ TEST(cli_find_cli_fallback_paths) {
355359
if (!cbm_mkdtemp(tmpdir))
356360
SKIP("cbm_mkdtemp failed");
357361

362+
#ifdef _WIN32
363+
rmdir(tmpdir);
364+
SKIP("fallback path lookup uses POSIX semantics");
365+
#endif
358366
char localbin[512];
359367
snprintf(localbin, sizeof(localbin), "%s/.local/bin", tmpdir);
360368
test_mkdirp(localbin);

0 commit comments

Comments
 (0)