summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2014-02-26 18:13:25 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2014-03-04 14:47:24 +0000
commit25e6196c435dc9f9b71440f22879ea91beca41e6 (patch)
tree48ad1d2b28f5d264996511eef21e42fcd415bc63
parentc09cfa3ec95933d3c8bb52d46e5edf6808513145 (diff)
downloadmorph-25e6196c435dc9f9b71440f22879ea91beca41e6.tar.gz
yarns: Fix how Morph is run
As we are running Morph from the source dir we need to set PYTHONPATH so that extensions are correctly loaded. Also, the version of Yarn in Baserock sets 'SRCDIR' so we do not need to set a default any more.
-rw-r--r--yarns/morph.shell-lib8
1 files changed, 2 insertions, 6 deletions
diff --git a/yarns/morph.shell-lib b/yarns/morph.shell-lib
index 31dcc7af..e025f8f5 100644
--- a/yarns/morph.shell-lib
+++ b/yarns/morph.shell-lib
@@ -22,17 +22,13 @@
# Run Morph from the source tree, ignoring any configuration files.
# This way the test suite is not affected by any configuration the user
# or system may have. Instead, we'll use the `$DATADIR/morph.conf` file,
-# which tests can create, if they want to. Unfortunately, currently yarn
-# does not set a $SRCDIR that points at the source tree, so if the test
-# needs to cd away from there, things can break. We work around this
-# by allowing the caller to set $SRCDIR if they want to, and if it isn't
-# set, we default to . (current working directory).
+# which tests can create, if they want to.
run_morph()
{
{
set +e
- "${SRCDIR:-.}"/morph \
+ PYTHONPATH="$SRCDIR" "$SRCDIR"/morph \
--cachedir-min-space=0 --tempdir-min-space=0 \
--no-default-config --config "$DATADIR/morph.conf" "$@" \
2> "$DATADIR/result-$1"