From cda81a0b19cbac2c1e4533f26a31697cd21205e2 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Tue, 27 Mar 2012 17:16:53 +0100 Subject: Refactor tests/*.script to use scripts/test-morph instead of tests/morph --- tests/build-chunk-distributed-local.script | 2 +- tests/build-chunk.script | 2 +- tests/build-stratum-distributed-local.script | 3 ++- tests/build-stratum.script | 2 +- tests/missing-ref.script | 9 ++------- tests/missing-ref.stderr | 2 +- tests/morph | 29 ---------------------------- tests/name-clash.script | 4 ++-- tests/rebuild-cached-stratum.script | 6 ++++-- tests/show-dependencies.script | 3 ++- 10 files changed, 16 insertions(+), 46 deletions(-) delete mode 100755 tests/morph (limited to 'tests') 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" -- cgit v1.2.1