summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2022-05-20 11:48:26 -0400
committerTavian Barnes <tavianator@tavianator.com>2022-05-20 11:54:50 -0400
commitd32c35244ae5484ff643d60a84577554e03ebdc6 (patch)
tree76928696271df8058ef881c1de86e993ce50c19f /tests
parentbedd8f409a41bf2a2c9650eeda56effeda852817 (diff)
downloadbfs-d32c35244ae5484ff643d60a84577554e03ebdc6.tar.xz
Makefile: Add a BUILDDIR variable for out-of-tree builds
bfs can now be built from a read-only source tree.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/tests.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/tests.sh b/tests/tests.sh
index 434e058..eaf5add 100755
--- a/tests/tests.sh
+++ b/tests/tests.sh
@@ -897,7 +897,12 @@ function _realpath() {
}
TESTS=$(_realpath "$(dirname -- "${BASH_SOURCE[0]}")")
-BIN=$(_realpath "$TESTS/../bin")
+
+if [ "$BUILDDIR" ]; then
+ BIN=$(_realpath "$BUILDDIR/bin")
+else
+ BIN=$(_realpath "$TESTS/../bin")
+fi
# Try to resolve the path to $BFS before we cd, while also supporting
# --bfs="./bin/bfs -S ids"