chiark / gitweb /
tests: Fix check target
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 14 Dec 2022 21:52:06 +0000 (21:52 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 14 Dec 2022 21:52:16 +0000 (21:52 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Makefile
test/common

index 3219c50e9bf7074f01622f805fc34fe79f9eafc4..98337c0c6634e00f9d60708eb3db66dbac3f1afc 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -50,6 +50,7 @@ stamp/cargo-%: $(call rsrcs,.)
        $(stamp)
 
 stamp/t-%: test/t-% stamp/cargo-build $(wildcard test/*[^~])
+       TARGET_RELEASE_DIR=$(abspath $(TARGET_RELEASE_DIR)) \
        $(NAILING_CARGO_JUST_RUN) \
        $(abspath test/capture-log) tmp/t-$*.log \
        $(abspath test/go-with-unshare test/t-$*)
index 14b8d1e981909513b62f192cecb3852442a049ac..f712514c3ee117dda7ddaec68b7a2d2512dba504 100644 (file)
@@ -9,6 +9,9 @@ ssrc="${0%/*}"
 src="${ssrc%/*}"
 test="${ssrc%/*}/test"
 
+target_bin_dir=${TARGET_RELEASE_DIR-target/debug}
+target_bin_prefix=${target_bin_dir}${target_bin_dir+/}
+
 fail () { echo >&2 "$0: fail: $*"; exit 1; }
 
 test-prep () {
@@ -46,11 +49,11 @@ in-ns () {
 
 run-client () {
     in-ns client \
-    target/debug/hippotat --config $test/test.cfg -DD "$@"
+    ${target_bin_prefix}hippotat --config $test/test.cfg -DD "$@"
 }
 run-server () {
     in-ns server \
-    target/debug/hippotatd --config $test/test.cfg -DD "$@"
+    ${target_bin_prefix}hippotatd --config $test/test.cfg -DD "$@"
 }
 spawn () {
     { exec=exec; "$@"; } &