4 if ! command -v virtualenv >/dev/null; then
5 echo "$0: virtualenv not installed, skipping python-using tests." 1>&2
9 SRCDIR="$(dirname "$0")"
11 # build directory, if different, can be passed as an argument;
12 # it is expected to point to the equivalent subdirectory of the
13 # tree as where this script is stored
17 # not set or looks like a flag to cram
20 # looks like the builddir
26 VENV="$BUILDDIR/virtualenv"
27 CRAM_BIN="$VENV/bin/cram"
28 if [ ! -e "$CRAM_BIN" ]; then
29 # With "make distcheck", the source directory must be read-only. I
30 # patched cram to support that. See upstream ticket at
31 # https://bitbucket.org/brodie/cram/issue/9/allow-read-only-directories-for-t
33 virtualenv "$VENV" && $VENV/bin/pip --log "$VENV"/log.txt install "$SRCDIR/downloads/cram-0.5.0ceph.2011-01-14.tar.gz"
36 SRCDIR_ABS="$(readlink -f "$SRCDIR")"
37 BUILDDIR_ABS="$(readlink -f "$BUILDDIR")"
38 FAKE_HOME="$BUILDDIR_ABS/fake_home"
41 # cram doesn't like seeing the same foo.t basename twice on the same
42 # run, so run it once per directory
45 for tool in "$SRCDIR"/cli/*; do
46 toolname="$(basename "$tool")"
47 install -d -m0755 -- "$BUILDDIR/cli/$toolname"
49 PATH="$BUILDDIR_ABS/..:$SRCDIR_ABS/..:$PATH" \
51 CCACHE_DIR="$CCACHE_DIR" \
55 "$SRCDIR/run-cli-tests-maybe-unset-ccache" \
56 "$CRAM_BIN" -v "$@" --error-dir="$BUILDDIR/cli/$toolname" -- "$tool"/*.t
59 FAILEDTOOLS="$FAILEDTOOLS $toolname"
63 if [ $FAILED -eq 1 ]; then
64 echo "Tests that failed: $FAILEDTOOLS"