diff options
-rwxr-xr-x | scripts/test-morph | 4 | ||||
-rwxr-xr-x | tests/build-chunk-distributed-local.script | 2 | ||||
-rwxr-xr-x | tests/build-chunk.script | 2 | ||||
-rwxr-xr-x | tests/build-stratum-distributed-local.script | 3 | ||||
-rwxr-xr-x | tests/build-stratum.script | 2 | ||||
-rwxr-xr-x | tests/missing-ref.script | 9 | ||||
-rw-r--r-- | tests/missing-ref.stderr | 2 | ||||
-rwxr-xr-x | tests/morph | 29 | ||||
-rwxr-xr-x | tests/name-clash.script | 4 | ||||
-rwxr-xr-x | tests/rebuild-cached-stratum.script | 6 | ||||
-rwxr-xr-x | tests/show-dependencies.script | 3 |
11 files changed, 20 insertions, 46 deletions
diff --git a/scripts/test-morph b/scripts/test-morph index 3c9e1131..42e086d0 100755 --- a/scripts/test-morph +++ b/scripts/test-morph @@ -23,6 +23,10 @@ set -eu +# Set PATH to include the source directory. This is necessary for +# distributed builds, which invoke morph as a sub-process. +export PATH="$SRCDIR:$PATH" + "$SRCDIR/scripts/cmd-filter" "$SRCDIR/morph" --no-default-config \ --config="$DATADIR/morph.conf" "$@" diff --git a/tests/build-chunk-distributed-local.script b/tests/build-chunk-distributed-local.script index e758492c..f38a0673 100755 --- a/tests/build-chunk-distributed-local.script +++ b/tests/build-chunk-distributed-local.script @@ -19,7 +19,7 @@ set -eu -tests/morph build-distributed chunk-repo farrokh hello.morph +"$SRCDIR/scripts/test-morph" build-distributed chunk-repo farrokh hello.morph for chunk in "$DATADIR/cache/"*.chunk.* do diff --git a/tests/build-chunk.script b/tests/build-chunk.script index e8fcd3a1..ba8b227f 100755 --- a/tests/build-chunk.script +++ b/tests/build-chunk.script @@ -19,7 +19,7 @@ set -eu -tests/morph build chunk-repo farrokh hello.morph +"$SRCDIR/scripts/test-morph" build chunk-repo farrokh hello.morph for chunk in "$DATADIR/cache/"*.chunk.* do diff --git a/tests/build-stratum-distributed-local.script b/tests/build-stratum-distributed-local.script index 673b6b1c..d69946eb 100755 --- a/tests/build-stratum-distributed-local.script +++ b/tests/build-stratum-distributed-local.script @@ -19,5 +19,6 @@ set -eu -tests/morph build-distributed morphs-repo master hello-stratum.morph +"$SRCDIR/scripts/test-morph" \ + build-distributed morphs-repo master hello-stratum.morph tar -tf "$DATADIR/cache/"*.stratum.* | LC_ALL=C sort | sed '/^\.\/./s:^\./::' diff --git a/tests/build-stratum.script b/tests/build-stratum.script index 442fad59..fbc61629 100755 --- a/tests/build-stratum.script +++ b/tests/build-stratum.script @@ -19,5 +19,5 @@ set -eu -tests/morph build morphs-repo master hello-stratum.morph +"$SRCDIR/scripts/test-morph" build morphs-repo master hello-stratum.morph tar -tf "$DATADIR/cache/"*.stratum.* | LC_ALL=C sort | sed '/^\.\/./s:^\./::' diff --git a/tests/missing-ref.script b/tests/missing-ref.script index 039b0037..445308da 100755 --- a/tests/missing-ref.script +++ b/tests/missing-ref.script @@ -17,10 +17,5 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -#tempdirs make script diffing cry -cache="$DATADIR/cache" -./morph --no-default-configs --config="$DATADIR/morph.conf" \ - build chunk-repo non-existent-branch hello.morph 2> "$DATADIR/stderr" -err=$? -cat "$DATADIR/stderr" | sed "s%$DATADIR%%" 1>&2 -exit $err +"$SRCDIR/scripts/test-morph" build chunk-repo non-existent-branch hello.morph + diff --git a/tests/missing-ref.stderr b/tests/missing-ref.stderr index 748a891c..53ccb055 100644 --- a/tests/missing-ref.stderr +++ b/tests/missing-ref.stderr @@ -1 +1 @@ -ERROR: non-existent-branch is an invalid reference for repo file:///chunk-repo +ERROR: non-existent-branch is an invalid reference for repo file://TMP/chunk-repo diff --git a/tests/morph b/tests/morph deleted file mode 100755 index 8ba3ae78..00000000 --- a/tests/morph +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# -# Run morph in a way suitable for tests. -# -# Copyright (C) 2012 Codethink Limited -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -set -eu - -fatalcat(){ - cat "$1" 1>&2 - return 1 -} - -PATH="$(pwd):$PATH" -./morph --no-default-config --config="$DATADIR/morph.conf" "$@" || \ - fatalcat "$DATADIR/morph.log" diff --git a/tests/name-clash.script b/tests/name-clash.script index a0895ccd..d4be1233 100755 --- a/tests/name-clash.script +++ b/tests/name-clash.script @@ -48,10 +48,10 @@ EOF ) # build the dodgy chunk -tests/morph build chunk-repo farrokh goodbye.morph +"$SRCDIR/scripts/test-morph" build chunk-repo farrokh goodbye.morph # build a stratum -tests/morph build morphs-repo master hello-stratum.morph +"$SRCDIR/scripts/test-morph" build morphs-repo master hello-stratum.morph # unpack it and check the contents INSTDIR="$DATADIR"/unpack diff --git a/tests/rebuild-cached-stratum.script b/tests/rebuild-cached-stratum.script index 4a8f46f4..31b3f587 100755 --- a/tests/rebuild-cached-stratum.script +++ b/tests/rebuild-cached-stratum.script @@ -37,7 +37,8 @@ cache="$DATADIR/cache" git commit --quiet -m "rebuild-cached-stratum" -a) # Build the first time. -tests/morph build morphs-repo rebuild-cached-stratum hello-stratum.morph +"$SRCDIR/scripts/test-morph" \ + build morphs-repo rebuild-cached-stratum hello-stratum.morph echo "first build:" (cd "$cache" && ls *.chunk.* *.stratum.* | sed 's/^[^.]*\./ /' | LC_ALL=C sort) @@ -48,7 +49,8 @@ echo "first build:" git commit --quiet -am change) # Rebuild. -tests/morph build morphs-repo rebuild-cached-stratum hello-stratum.morph +"$SRCDIR/scripts/test-morph" \ + build morphs-repo rebuild-cached-stratum hello-stratum.morph echo "second build:" (cd "$cache" && ls *.chunk.* *.stratum.* | sed 's/^[^.]*\./ /' | LC_ALL=C sort) diff --git a/tests/show-dependencies.script b/tests/show-dependencies.script index 4b28078f..3c2abcd9 100755 --- a/tests/show-dependencies.script +++ b/tests/show-dependencies.script @@ -20,5 +20,6 @@ set -eu -tests/morph show-dependencies test-repo master xfce-core.morph | \ +"$SRCDIR/scripts/test-morph" \ + show-dependencies test-repo master xfce-core.morph | \ sed "s,$DATADIR,TMP,g" |