diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2024-03-27 11:27:01 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2024-03-27 13:13:23 -0400 |
commit | bca78d2597c78b0166d76d023eee1354f5abd04e (patch) | |
tree | cfe0b39dc687e1014a7e5bf138d6f9df0b1acd0b /tests/xspawnee.c | |
parent | 25769288f62816d733004c9e8347c35dd0e4ce2a (diff) | |
download | bfs-bca78d2597c78b0166d76d023eee1354f5abd04e.tar.xz |
tests/xspawn: New unit test
Diffstat (limited to 'tests/xspawnee.c')
-rw-r--r-- | tests/xspawnee.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/xspawnee.c b/tests/xspawnee.c new file mode 100644 index 0000000..b0a76ca --- /dev/null +++ b/tests/xspawnee.c @@ -0,0 +1,17 @@ +// Copyright © Tavian Barnes <tavianator@tavianator.com> +// SPDX-License-Identifier: 0BSD + +#include <stdlib.h> +#include <string.h> + +/** Child binary for bfs_spawn() tests. */ +int main(int argc, char *argv[]) { + if (argc >= 2) { + const char *path = getenv("PATH"); + if (!path || strcmp(path, argv[1]) != 0) { + return EXIT_FAILURE; + } + } + + return EXIT_SUCCESS; +} |