Skip to content

Commit c3ee977

Browse files
committed
test(process): use /bin/sh not /bin/true (absent on macOS)
The macOS CI failures across every launcher attempt were this test, not the implementation: /bin/true lives at /usr/bin/true on macOS, so run_exec returned 127 and the rc==0 assertion failed. Use /bin/sh -c 'exit 0' (present on Linux and macOS).
1 parent 115800a commit c3ee977

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

tests/unit/test_process_run_exec.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ using namespace mcpp::platform;
1717
// into /bin/sh and crashed it on newer-glibc hosts.
1818
TEST(RunExec, DoesNotMutateParentEnvironment) {
1919
::setenv("MCPP_TEST_LEAK", "sentinel", 1);
20-
int rc = process::run_exec({"/bin/true"},
20+
// Use /bin/sh (present on Linux AND macOS) — /bin/true lives at
21+
// /usr/bin/true on macOS, so it is not a portable launch target.
22+
int rc = process::run_exec({"/bin/sh", "-c", "exit 0"},
2123
{{"MCPP_TEST_LEAK", "injected"}});
2224
EXPECT_EQ(rc, 0);
2325
const char* v = ::getenv("MCPP_TEST_LEAK");

0 commit comments

Comments
 (0)