From: Ian Jackson Date: Wed, 14 Dec 2022 21:52:06 +0000 (+0000) Subject: tests: Fix check target X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=c6693c6b804a275b7a6e0cbe93b5934b8094f659;p=hippotat.git tests: Fix check target Signed-off-by: Ian Jackson --- diff --git a/Makefile b/Makefile index 3219c50..98337c0 100644 --- 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-$*) diff --git a/test/common b/test/common index 14b8d1e..f712514 100644 --- a/test/common +++ b/test/common @@ -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; "$@"; } &