Skip to content

Commit

Permalink
Disable argv[0] tests on non-XnuSilicon (#1015)
Browse files Browse the repository at this point in the history
Adds a TODO explaining the correct condition.
  • Loading branch information
mrdomino authored Dec 25, 2023
1 parent 25266b0 commit 4c6f928
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/libc/calls/getprogramexecutablename_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,15 @@ void SetUpOnce(void) {

__attribute__((__constructor__)) static void Child(int argc, char *argv[]) {
static bool skiparg0tests;
if (!__program_executable_name && !IsFreebsd() && !IsNetbsd()) {
if (!IsXnuSilicon()) {
/* TODO(mrdomino): these tests only pass on XnuSilicon right now because
__sys_execve fails there, so the ape loader is used.
the correct check here is "we have been invoked either
as an assimilated binary or via the ape loader, and not
via a raw __sys_execve." */
skiparg0tests = true;
if (argc < 2) {
fprintf(stderr, "warning: old/no loader; skipping argv[0] tests\n");
fprintf(stderr, "warning: skipping argv[0] tests\n");
}
}
if (argc >= 2 && !strcmp(argv[1], "Child")) {
Expand Down

0 comments on commit 4c6f928

Please sign in to comment.