summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-03-27 17:16:53 +0100
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-03-27 17:16:53 +0100
commitcda81a0b19cbac2c1e4533f26a31697cd21205e2 (patch)
treef0eb96c89323e4ed5071a2ab5b014c5c6c4263f7 /tests
parentba4c24a51d2ad7177964416c2420df7f4a337b8e (diff)
downloadmorph-cda81a0b19cbac2c1e4533f26a31697cd21205e2.tar.gz
Refactor tests/*.script to use scripts/test-morph instead of tests/morph
Diffstat (limited to 'tests')
-rwxr-xr-xtests/build-chunk-distributed-local.script2
-rwxr-xr-xtests/build-chunk.script2
-rwxr-xr-xtests/build-stratum-distributed-local.script3
-rwxr-xr-xtests/build-stratum.script2
-rwxr-xr-xtests/missing-ref.script9
-rw-r--r--tests/missing-ref.stderr2
-rwxr-xr-xtests/morph29
-rwxr-xr-xtests/name-clash.script4
-rwxr-xr-xtests/rebuild-cached-stratum.script6
-rwxr-xr-xtests/show-dependencies.script3
10 files changed, 16 insertions, 46 deletions
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"