summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.am2
-rwxr-xr-xsrc/test/run-cli-tests18
2 files changed, 18 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am
index aa91d448de0..84f2fa85060 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -13,7 +13,7 @@ check-local:
@cd src/gtest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la
# exercise cli tools
- $(srcdir)/src/test/run-cli-tests
+ $(srcdir)/src/test/run-cli-tests '$(top_builddir)/src/test'
# "make distclean" both runs this and recurses into src/gtest, if
# gtest is in DIST_SUBDIRS. Take extra care to not fail when
diff --git a/src/test/run-cli-tests b/src/test/run-cli-tests
index 24a2d2d4654..f2bd8194228 100755
--- a/src/test/run-cli-tests
+++ b/src/test/run-cli-tests
@@ -7,7 +7,23 @@ if ! command -v pip >/dev/null; then
fi
SRCDIR="$(dirname "$0")"
-VENV="$SRCDIR/virtualenv"
+
+# build directory, if different, can be passed as an argument;
+# it is expected to point to the equivalent subdirectory of the
+# tree as where this script is stored
+BUILDDIR="$SRCDIR"
+case "$1" in
+ ''|-*)
+ # not set or looks like a flag to cram
+ ;;
+ *)
+ # looks like the builddir
+ BUILDDIR="$1"
+ shift
+ ;;
+esac
+
+VENV="$BUILDDIR/virtualenv"
CRAM_BIN="$VENV/bin/cram"
if [ ! -e "$CRAM_BIN" ]; then
pip -E "$VENV" install "$SRCDIR/downloads/cram-0.5.tar.gz"