summaryrefslogtreecommitdiffstats
path: root/tests/xspawnee.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-03-27 11:27:01 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-03-27 13:13:23 -0400
commitbca78d2597c78b0166d76d023eee1354f5abd04e (patch)
treecfe0b39dc687e1014a7e5bf138d6f9df0b1acd0b /tests/xspawnee.c
parent25769288f62816d733004c9e8347c35dd0e4ce2a (diff)
downloadbfs-bca78d2597c78b0166d76d023eee1354f5abd04e.tar.xz
tests/xspawn: New unit test
Diffstat (limited to 'tests/xspawnee.c')
-rw-r--r--tests/xspawnee.c17
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;
+}