summaryrefslogtreecommitdiffstats
path: root/tests/xspawn.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-04-29 15:30:39 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-04-29 16:25:46 -0400
commit37caa3d71fd8bb4d0d9204e4a2f5cac234fa25fd (patch)
treeaf4dd493b89a17dfdce2957dac90f068decf1667 /tests/xspawn.c
parentb8ed989642b9f0f6c1301bcff6f1498935cbd81c (diff)
downloadbfs-37caa3d71fd8bb4d0d9204e4a2f5cac234fa25fd.tar.xz
build: Replace `make config` with a `./configure` script
This lets us do more traditional out-of-tree builds like $ ../path/to/bfs/configure $ make The .mk files are moved from ./config to ./build, mostly so that ./configure will auto-complete easily.
Diffstat (limited to 'tests/xspawn.c')
-rw-r--r--tests/xspawn.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/tests/xspawn.c b/tests/xspawn.c
index 7362aa5..785ea48 100644
--- a/tests/xspawn.c
+++ b/tests/xspawn.c
@@ -64,27 +64,20 @@ static bool check_use_path(bool use_posix) {
spawn.flags &= ~BFS_SPAWN_USE_POSIX;
}
- const char *builddir = getenv("BUILDDIR");
- dchar *bin = dstrprintf("%s/bin", builddir ? builddir : ".");
- ret &= bfs_pcheck(bin, "dstrprintf()");
- if (!ret) {
- goto destroy;
- }
-
- ret &= bfs_pcheck(bfs_spawn_addopen(&spawn, 10, bin, O_RDONLY | O_DIRECTORY, 0) == 0);
+ ret &= bfs_pcheck(bfs_spawn_addopen(&spawn, 10, "bin", O_RDONLY | O_DIRECTORY, 0) == 0);
ret &= bfs_pcheck(bfs_spawn_adddup2(&spawn, 10, 11) == 0);
ret &= bfs_pcheck(bfs_spawn_addclose(&spawn, 10) == 0);
ret &= bfs_pcheck(bfs_spawn_addfchdir(&spawn, 11) == 0);
ret &= bfs_pcheck(bfs_spawn_addclose(&spawn, 11) == 0);
if (!ret) {
- goto bin;
+ goto destroy;
}
// Check that $PATH is resolved in the parent's environment
char **envp;
ret &= bfs_pcheck(envp = envdup());
if (!ret) {
- goto bin;
+ goto destroy;
}
// Check that $PATH is resolved after the file actions
@@ -138,8 +131,6 @@ env:
free(*var);
}
free(envp);
-bin:
- dstrfree(bin);
destroy:
ret &= bfs_pcheck(bfs_spawn_destroy(&spawn) == 0);
out: