From 5045695cd8118c2b56a762fb8dbeb542bd05b5ac Mon Sep 17 00:00:00 2001 From: Tommi Virtanen Date: Thu, 13 Jan 2011 12:59:11 -0800 Subject: [PATCH] Teach run-cli-tests about build dirs. An optional argument points can tell it where to put generated files (in this case, virtualenv). Provide the argument in Makefile.am. Options are still passed to cram, so you can say "./src/test/run-cli-tests -i". --- Makefile.am | 2 +- src/test/run-cli-tests | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index aa91d448de052..84f2fa8506057 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 24a2d2d4654b6..f2bd8194228e9 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" -- 2.39.5