diff options
Diffstat (limited to 'yarns/morph.shell-lib')
-rw-r--r-- | yarns/morph.shell-lib | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/yarns/morph.shell-lib b/yarns/morph.shell-lib index e025f8f5..05c11bcc 100644 --- a/yarns/morph.shell-lib +++ b/yarns/morph.shell-lib @@ -19,6 +19,15 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# Add $SRCDIR to PYTHONPATH. + +case "$PYTHONPATH" in + '') PYTHONPATH="$SRCDIR)" ;; + *) PYTHONPATH="$SRCDIR:$PYTHONPATH" ;; +esac +export PYTHONPATH + + # 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, @@ -28,7 +37,7 @@ run_morph() { { set +e - PYTHONPATH="$SRCDIR" "$SRCDIR"/morph \ + "$SRCDIR"/morph \ --cachedir-min-space=0 --tempdir-min-space=0 \ --no-default-config --config "$DATADIR/morph.conf" "$@" \ 2> "$DATADIR/result-$1" @@ -148,15 +157,6 @@ assert_morphologies_are_petrified() } -# Currently, yarn isn't setting $SRCDIR to point at the project source -# directory. We simulate this here. - -if ! env | grep '^SRCDIR=' > /dev/null -then - export SRCDIR="$(pwd)" -fi - - # Added until it's fixed in upstream. # It's a solution to create an empty home directory each execution export HOME="$DATADIR/home" @@ -174,3 +174,12 @@ then email = tomjon@codethink.co.uk EOF fi + + +# Change colons to slashes. This is used when converting an aliases +# repository URL (e.g., test:morphs) into a directory path. + +slashify_colons() +{ + echo "$1" | sed s,:,/,g +} |