From 8d9a939630bc677c2d2e7c4202a400f9bc0ab3ad Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Tue, 29 Jan 2013 11:58:13 +0000 Subject: Separate out build tests from general Morph tests --- tests/ambiguous-refs.script | 32 ------ tests/build-chunk-failures-dump-log.exit | 1 - tests/build-chunk-failures-dump-log.script | 42 -------- tests/build-chunk-failures-dump-log.stdout | 8 -- tests/build-chunk-writes-log.script | 37 ------- tests/build-chunk.script | 30 ------ tests/build-chunk.stdout | 8 -- tests/build-stratum-with-submodules.script | 75 ------------- tests/build-stratum-with-submodules.stdout | 4 - tests/build-stratum.script | 29 ----- tests/build-stratum.stdout | 7 -- ...ld-system-autotools-fails-if-autogen-fails.exit | 1 - ...-system-autotools-fails-if-autogen-fails.script | 39 ------- tests/build-system-autotools.script | 57 ---------- tests/build-system-autotools.stdout | 8 -- tests/build-system-cpan.script | 65 ------------ tests/build-system-cpan.stdout | 2 - tests/build-system-python-distutils.script | 67 ------------ tests/build-system-python-distutils.stdout | 10 -- tests/missing-ref.exit | 1 - tests/missing-ref.script | 23 ---- tests/missing-ref.stderr | 1 - tests/morphless-chunks.script | 71 ------------- tests/morphless-chunks.stdout | 5 - tests/rebuild-cached-stratum.script | 58 ---------- tests/rebuild-cached-stratum.stdout | 8 -- tests/stratum-overlap-warns.script | 39 ------- tests/stratum-overlap-warns.setup | 117 --------------------- tests/stratum-overlap-writes-overlap.script | 35 ------ tests/stratum-overlap-writes-overlap.setup | 1 - tests/stratum-overlap-writes-overlap.stdout | 4 - tests/uses-tempdir.script | 28 ----- 32 files changed, 913 deletions(-) delete mode 100755 tests/ambiguous-refs.script delete mode 100644 tests/build-chunk-failures-dump-log.exit delete mode 100755 tests/build-chunk-failures-dump-log.script delete mode 100644 tests/build-chunk-failures-dump-log.stdout delete mode 100755 tests/build-chunk-writes-log.script delete mode 100755 tests/build-chunk.script delete mode 100644 tests/build-chunk.stdout delete mode 100755 tests/build-stratum-with-submodules.script delete mode 100644 tests/build-stratum-with-submodules.stdout delete mode 100755 tests/build-stratum.script delete mode 100644 tests/build-stratum.stdout delete mode 100644 tests/build-system-autotools-fails-if-autogen-fails.exit delete mode 100755 tests/build-system-autotools-fails-if-autogen-fails.script delete mode 100755 tests/build-system-autotools.script delete mode 100644 tests/build-system-autotools.stdout delete mode 100755 tests/build-system-cpan.script delete mode 100644 tests/build-system-cpan.stdout delete mode 100755 tests/build-system-python-distutils.script delete mode 100644 tests/build-system-python-distutils.stdout delete mode 100644 tests/missing-ref.exit delete mode 100755 tests/missing-ref.script delete mode 100644 tests/missing-ref.stderr delete mode 100755 tests/morphless-chunks.script delete mode 100644 tests/morphless-chunks.stdout delete mode 100755 tests/rebuild-cached-stratum.script delete mode 100644 tests/rebuild-cached-stratum.stdout delete mode 100755 tests/stratum-overlap-warns.script delete mode 100755 tests/stratum-overlap-warns.setup delete mode 100755 tests/stratum-overlap-writes-overlap.script delete mode 120000 tests/stratum-overlap-writes-overlap.setup delete mode 100644 tests/stratum-overlap-writes-overlap.stdout delete mode 100755 tests/uses-tempdir.script (limited to 'tests') diff --git a/tests/ambiguous-refs.script b/tests/ambiguous-refs.script deleted file mode 100755 index 58d09d26..00000000 --- a/tests/ambiguous-refs.script +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2011, 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. - - -## Guard against a bug that occurs if 'git show-ref' is used to resolve refs -## instead of 'git rev-parse --verify': show-ref returns a list of partial -## matches sorted alphabetically, so any code using it may resolve refs - -set -eu - -# Create a ref that will show up in 'git show-ref' before the real master ref -cd "$DATADIR/morphs-repo" -git checkout -q -b alpha/master -git rm -q hello-stratum.morph -git commit -q -m "This ref will not build correctly" - -"$SRCDIR/scripts/test-morph" build-morphology \ - test:morphs-repo master hello-stratum diff --git a/tests/build-chunk-failures-dump-log.exit b/tests/build-chunk-failures-dump-log.exit deleted file mode 100644 index d00491fd..00000000 --- a/tests/build-chunk-failures-dump-log.exit +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/tests/build-chunk-failures-dump-log.script b/tests/build-chunk-failures-dump-log.script deleted file mode 100755 index 3e0985d8..00000000 --- a/tests/build-chunk-failures-dump-log.script +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -# -# Copyright (C) 2011, 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. - - -## Test building a chunk that fails. - -set -eu - -chunkrepo="$DATADIR/chunk-repo" -cd "$chunkrepo" -git checkout --quiet master -cat <false.morph -{ - "name": "false", - "kind": "chunk", - "build-system": "dummy", - "build-commands": [ - "echo The next command will fail", - "false" - ] -} -EOF -git add false.morph -git commit --quiet -m "Make a morphology that fails." - -"$SRCDIR/scripts/test-morph" build-morphology \ - test:chunk-repo master false \ - 2>/dev/null diff --git a/tests/build-chunk-failures-dump-log.stdout b/tests/build-chunk-failures-dump-log.stdout deleted file mode 100644 index 7a13c12a..00000000 --- a/tests/build-chunk-failures-dump-log.stdout +++ /dev/null @@ -1,8 +0,0 @@ -build failed -# configure -# # echo dummy configure -dummy configure -# build -# # echo The next command will fail -The next command will fail -# # false diff --git a/tests/build-chunk-writes-log.script b/tests/build-chunk-writes-log.script deleted file mode 100755 index a258bf99..00000000 --- a/tests/build-chunk-writes-log.script +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2011, 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. - - -## Test building a chunk - build log should be saved. - -set -eu - -"$SRCDIR/scripts/test-morph" build-morphology test:chunk-repo farrokh hello - -SOURCES="$DATADIR/cached-sources" -find "$DATADIR/cache/artifacts" -name '*.chunk.*' | - sed 's|\.chunk\..*||' | sort -u >"$SOURCES" - -found=false -# list of sources in cache is not piped because while loop changes variable -while read source; do - [ -e "$source".build-log ] || continue - found=true - break -done <"$SOURCES" -"$found" - diff --git a/tests/build-chunk.script b/tests/build-chunk.script deleted file mode 100755 index 9728f939..00000000 --- a/tests/build-chunk.script +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2011, 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. - - -## Test building a chunk. - -set -eu - -"$SRCDIR/scripts/test-morph" build-morphology test:chunk-repo farrokh hello - -for chunk in "$DATADIR/cache/artifacts/"*.chunk.* -do - echo "$chunk:" | sed 's/[^.]*//' - tar -tf "$chunk" | LC_ALL=C sort | sed '/^\.\/./s:^\./::' - echo -done diff --git a/tests/build-chunk.stdout b/tests/build-chunk.stdout deleted file mode 100644 index 8077cac2..00000000 --- a/tests/build-chunk.stdout +++ /dev/null @@ -1,8 +0,0 @@ -.chunk.hello: -./ -baserock/ -baserock/hello.meta -bin/ -bin/hello -etc/ - diff --git a/tests/build-stratum-with-submodules.script b/tests/build-stratum-with-submodules.script deleted file mode 100755 index 1799d74a..00000000 --- a/tests/build-stratum-with-submodules.script +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2011, 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. - - -## Test build a stratum that uses a chunk which needs a submodule. - -set -eu - -# tests/setup creates a chunk-repo. We now create a new chunk, which -# uses chunk-repo as a submodule. - -parent="$DATADIR/parent-repo" -mkdir "$parent" -cat < "$parent/parent.morph" -{ - "name": "parent", - "kind": "chunk", - "build-system": "manual", - "build-commands": [ - "test -f le-sub/README" - ] -} -EOF - -"$SRCDIR/scripts/run-git-in" "$parent" init --quiet -"$SRCDIR/scripts/run-git-in" "$parent" add . -"$SRCDIR/scripts/run-git-in" "$parent" \ - submodule --quiet add -b farrokh "$DATADIR/chunk-repo" le-sub > /dev/null -"$SRCDIR/scripts/run-git-in" "$parent" commit --quiet -m initial - - -# Modify the stratum to refer to the parent, not the submodule. - -morphs="$DATADIR/morphs-repo" -cat < "$morphs/submod-stratum.morph" -{ - "name": "submod-stratum", - "kind": "stratum", - "chunks": [ - { - "name": "parent", - "repo": "test:parent-repo", - "ref": "master", - "build-depends": [] - } - ] -} -EOF -"$SRCDIR/scripts/run-git-in" "$morphs" add submod-stratum.morph -"$SRCDIR/scripts/run-git-in" "$morphs" commit --quiet -m 'foo' - - -# No build and verify we got a stratum. - -"$SRCDIR/scripts/test-morph" build-morphology \ - test:morphs-repo master submod-stratum -"$SRCDIR/scripts/assemble-stratum" --cachedir "$DATADIR/cache" \ - "$DATADIR/cache/artifacts/"*submod-stratum \ - "$DATADIR/stratum.tar" submod-stratum -tar -tf "$DATADIR/stratum.tar" | LC_ALL=C sort | sed '/^\.\/./s:^\./::' - diff --git a/tests/build-stratum-with-submodules.stdout b/tests/build-stratum-with-submodules.stdout deleted file mode 100644 index a5f677f3..00000000 --- a/tests/build-stratum-with-submodules.stdout +++ /dev/null @@ -1,4 +0,0 @@ -./ -baserock/ -baserock/parent.meta -baserock/submod-stratum.meta diff --git a/tests/build-stratum.script b/tests/build-stratum.script deleted file mode 100755 index ac210129..00000000 --- a/tests/build-stratum.script +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2011, 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. - - -## Test build a simple stratum. - -set -eu - -"$SRCDIR/scripts/test-morph" build-morphology \ - test:morphs-repo master hello-stratum -"$SRCDIR/scripts/assemble-stratum" --cachedir "$DATADIR/cache" \ - "$DATADIR/cache/artifacts/"*.hello-stratum \ - "$DATADIR/stratum.tar" hello-stratum -tar -tf "$DATADIR/stratum.tar" | LC_ALL=C sort | sed '/^\.\/./s:^\./::' - diff --git a/tests/build-stratum.stdout b/tests/build-stratum.stdout deleted file mode 100644 index 4f422ea4..00000000 --- a/tests/build-stratum.stdout +++ /dev/null @@ -1,7 +0,0 @@ -./ -baserock/ -baserock/hello-stratum.meta -baserock/hello.meta -bin/ -bin/hello -etc/ diff --git a/tests/build-system-autotools-fails-if-autogen-fails.exit b/tests/build-system-autotools-fails-if-autogen-fails.exit deleted file mode 100644 index d00491fd..00000000 --- a/tests/build-system-autotools-fails-if-autogen-fails.exit +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/tests/build-system-autotools-fails-if-autogen-fails.script b/tests/build-system-autotools-fails-if-autogen-fails.script deleted file mode 100755 index 46510516..00000000 --- a/tests/build-system-autotools-fails-if-autogen-fails.script +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -# -# 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. - - -## Test that the autotools build system fails if it runs autogen.sh and that -## fails. - -set -eu - -x="$DATADIR/autogen-chunk" -mkdir "$x" -cat < "$x/autogen.sh" -#!/bin/sh -echo "in failing autogen.sh" -exit 1 -EOF -chmod a+x "$x/autogen.sh" -"$SRCDIR/scripts/run-git-in" "$x" init --quiet -"$SRCDIR/scripts/run-git-in" "$x" add . -"$SRCDIR/scripts/run-git-in" "$x" commit --quiet -m initial - -"$SRCDIR/scripts/test-morph" build-morphology \ - test:autogen-chunk master detected \ - >/dev/null 2> /dev/null - diff --git a/tests/build-system-autotools.script b/tests/build-system-autotools.script deleted file mode 100755 index 6037d1b5..00000000 --- a/tests/build-system-autotools.script +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2011, 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. - - -## Convert the hello-chunk project to something autotools-like, then -## build it. - -set -eu - -chunkrepo="$DATADIR/chunk-repo" -cd "$chunkrepo" - -git checkout --quiet farrokh - -cat <<'EOF' >Makefile -all: hello - -install: all - install -d "$(DESTDIR)/etc" - install -d "$(DESTDIR)/bin" - install hello "$(DESTDIR)/bin/hello" -EOF -git add Makefile - -cat < hello.morph -{ - "name": "hello", - "kind": "chunk", - "build-system": "autotools", - "configure-commands": [] -} -EOF -git add hello.morph -git commit --quiet -m "Convert hello to an autotools project" - -"$SRCDIR/scripts/test-morph" build-morphology test:chunk-repo farrokh hello - -for chunk in "$DATADIR/cache/artifacts/"*.chunk.* -do - echo "$chunk:" | sed 's/[^.]*//' - tar -tf "$chunk" | LC_ALL=C sort | sed '/^\.\/./s:^\./::' - echo -done diff --git a/tests/build-system-autotools.stdout b/tests/build-system-autotools.stdout deleted file mode 100644 index 8077cac2..00000000 --- a/tests/build-system-autotools.stdout +++ /dev/null @@ -1,8 +0,0 @@ -.chunk.hello: -./ -baserock/ -baserock/hello.meta -bin/ -bin/hello -etc/ - diff --git a/tests/build-system-cpan.script b/tests/build-system-cpan.script deleted file mode 100755 index 9217ab16..00000000 --- a/tests/build-system-cpan.script +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2011, 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. - - -## Convert the hello-chunk project to perl with CPAN and build. - -set -eu - -chunkrepo="$DATADIR/chunk-repo" -cd "$chunkrepo" - -git checkout --quiet farrokh - -git rm --quiet hello.c - -cat <hello -#!/usr/bin/perl -print "hello, world\n" -EOF -git add hello - -cat <Makefile.PL -use strict; -use warnings; -use ExtUtils::MakeMaker; -WriteMakefile( - EXE_FILES => ['hello'], -) -EOF -git add Makefile.PL - -cat <hello.morph -{ - "name": "hello", - "kind": "chunk", - "build-system": "cpan" -} -EOF -git add hello.morph - -git commit --quiet -m 'convert hello into a perl cpan project' - -"$SRCDIR/scripts/test-morph" build-morphology --prefix=/ \ - test:chunk-repo farrokh hello - -for chunk in "$DATADIR/cache/artifacts/"*.chunk.* -do - echo "$chunk:" | sed 's/[^.]*//' - tar -tf "$chunk" | LC_ALL=C sort | - sed -e '/^\.\/./s:^\./::' | grep -F "bin/hello" -done diff --git a/tests/build-system-cpan.stdout b/tests/build-system-cpan.stdout deleted file mode 100644 index 5cbe4c73..00000000 --- a/tests/build-system-cpan.stdout +++ /dev/null @@ -1,2 +0,0 @@ -.chunk.hello: -bin/hello diff --git a/tests/build-system-python-distutils.script b/tests/build-system-python-distutils.script deleted file mode 100755 index 683599f2..00000000 --- a/tests/build-system-python-distutils.script +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2011, 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. - - -## Convert the hello-chunk project to python with distutils and build. - -set -eu - -chunkrepo="$DATADIR/chunk-repo" -cd "$chunkrepo" - -git checkout --quiet farrokh - -git rm --quiet hello.c -cat <hello -#!/usr/bin/python -print "hello, world" -EOF -git add hello - -cat <setup.py -#!/usr/bin/python -from distutils.core import setup -setup(name='hello', - scripts=['hello']) -EOF -git add setup.py - -cat <hello.morph -{ - "name": "hello", - "kind": "chunk", - "build-system": "python-distutils" -} -EOF -git add hello.morph - -git commit --quiet -m 'convert hello into a python project' - -"$SRCDIR/scripts/test-morph" build-morphology --prefix= \ - test:chunk-repo farrokh hello - -for chunk in "$DATADIR/cache/artifacts/"*.chunk.* -do - echo "$chunk:" | sed 's/[^.]*//' - tar -tf "$chunk" | LC_ALL=C sort | sed '/^\.\/./s:^\./::' - echo -done | -sed -e 's:^local/::' \ - -e 's:lib/python2.[6-9]/:lib/python2.x/:' \ - -e 's:/hello-0\.0\.0[^/]*\.egg-info$:/hello.egg-info/:' \ - -e 's:[^/]*-packages:packages:' \ - -e '/^$/d' diff --git a/tests/build-system-python-distutils.stdout b/tests/build-system-python-distutils.stdout deleted file mode 100644 index 4d4abdbb..00000000 --- a/tests/build-system-python-distutils.stdout +++ /dev/null @@ -1,10 +0,0 @@ -.chunk.hello: -./ -baserock/ -baserock/hello.meta -bin/ -bin/hello -lib/ -lib/python2.x/ -lib/python2.x/packages/ -lib/python2.x/packages/hello.egg-info/ diff --git a/tests/missing-ref.exit b/tests/missing-ref.exit deleted file mode 100644 index d00491fd..00000000 --- a/tests/missing-ref.exit +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/tests/missing-ref.script b/tests/missing-ref.script deleted file mode 100755 index 26183af3..00000000 --- a/tests/missing-ref.script +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2011,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. - - -## Test building with a bad reference. - -"$SRCDIR/scripts/test-morph" build-morphology \ - test:chunk-repo non-existent-branch hello - diff --git a/tests/missing-ref.stderr b/tests/missing-ref.stderr deleted file mode 100644 index d2b5d254..00000000 --- a/tests/missing-ref.stderr +++ /dev/null @@ -1 +0,0 @@ -ERROR: Ref non-existent-branch is an invalid reference for repo file://TMP/chunk-repo diff --git a/tests/morphless-chunks.script b/tests/morphless-chunks.script deleted file mode 100755 index d7b068da..00000000 --- a/tests/morphless-chunks.script +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/sh -# -# 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. - - -## Try to build a morphless chunk. - -set -eu - -# Create an auto-detectable chunk. - -mkdir "$DATADIR/morphless" -cd "$DATADIR/morphless" - -touch configure -chmod +x configure -# FIXME: If we leave the file empty, busybox sh on ARMv7 fails to execute it. -echo '#!/bin/sh' > configure - -cat << EOF > Makefile -all install: -EOF - -git init --quiet -git add * -git commit --quiet -m initial - - -# Create a stratum that refers to the morphless chunk. - -mkdir "$DATADIR/stratum" -cd "$DATADIR/stratum" -cat << EOF > alfred.morph -{ - "name": "alfred", - "kind": "stratum", - "chunks": [ - { - "name": "morphless", - "repo": "test:morphless", - "ref": "master", - "build-depends": [] - } - ] -} -EOF -git init --quiet -git add alfred.morph -git commit --quiet -m initial - -"$SRCDIR/scripts/test-morph" build-morphology test:stratum master alfred - -for chunk in "$DATADIR/cache/artifacts/"*.chunk.* -do - echo "$chunk:" | sed 's/[^.]*//' - tar -tf "$chunk" | LC_ALL=C sort | sed '/^\.\/./s:^\./::' - echo -done diff --git a/tests/morphless-chunks.stdout b/tests/morphless-chunks.stdout deleted file mode 100644 index 8e17b29a..00000000 --- a/tests/morphless-chunks.stdout +++ /dev/null @@ -1,5 +0,0 @@ -.chunk.morphless: -./ -baserock/ -baserock/morphless.meta - diff --git a/tests/rebuild-cached-stratum.script b/tests/rebuild-cached-stratum.script deleted file mode 100755 index 70cc54cf..00000000 --- a/tests/rebuild-cached-stratum.script +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2011, 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. - - -## Does a cached stratum get rebuilt if its chunk changes? -## This tests a bug that is currently in morph, where the stratum does -## not get rebuilt in that case. Later on, the test will guard against -## regressions. - -set -eu - -cache="$DATADIR/cache/artifacts" - -# Make a branch in the chunk repo where we can make our own modifications. -(cd "$DATADIR/chunk-repo" && - git checkout --quiet farrokh && - git checkout --quiet -b rebuild-cached-stratum) - -# Make a branch in the morphs repo and modify the stratum to refer to -# the new chunk branch. -(cd "$DATADIR/morphs-repo" && - git checkout --quiet -b rebuild-cached-stratum && - sed -i 's/farrokh/rebuild-cached-stratum/' hello-stratum.morph && - git commit --quiet -m "rebuild-cached-stratum" -a) - -# Build the first time. -"$SRCDIR/scripts/test-morph" build-morphology \ - test:morphs-repo rebuild-cached-stratum hello-stratum -echo "first build:" -(cd "$cache" && ls *.chunk.* *hello-stratum | sed 's/^[^.]*\./ /' | - LC_ALL=C sort) - -# Change the chunk. -(cd "$DATADIR/chunk-repo" && - echo >> hello.c && - git commit --quiet -am change) - -# Rebuild. -"$SRCDIR/scripts/test-morph" build-morphology \ - test:morphs-repo rebuild-cached-stratum hello-stratum -echo "second build:" -(cd "$cache" && ls *.chunk.* *hello-stratum | sed 's/^[^.]*\./ /' | - LC_ALL=C sort) - diff --git a/tests/rebuild-cached-stratum.stdout b/tests/rebuild-cached-stratum.stdout deleted file mode 100644 index eee106f5..00000000 --- a/tests/rebuild-cached-stratum.stdout +++ /dev/null @@ -1,8 +0,0 @@ -first build: - chunk.hello - stratum.hello-stratum -second build: - chunk.hello - chunk.hello - stratum.hello-stratum - stratum.hello-stratum diff --git a/tests/stratum-overlap-warns.script b/tests/stratum-overlap-warns.script deleted file mode 100755 index c9aeed72..00000000 --- a/tests/stratum-overlap-warns.script +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2011, 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. - - -## If a stratum has multiple chunks that have the same files in them, -## then this should be noted. - -set -eu - -log="$DATADIR/morph.log" -warnings="$DATADIR/warnings" -cache="$DATADIR/cache/artifacts" - -warning_mentions(){ - grep -F "$1" <"$warnings" >/dev/null 2>/dev/null -} - -"$SRCDIR/scripts/test-morph" build-morphology --log=$log \ - test:morphs-repo overlap overlap-stratum > /dev/null -grep WARNING "$log" >"$warnings" -for str in overlap-stratum \ - overlap-foo-baz overlap-foobar bin/bar \ - overlap-fooqux bin/foo; do - warning_mentions 'overlap-stratum' || exit $? -done diff --git a/tests/stratum-overlap-warns.setup b/tests/stratum-overlap-warns.setup deleted file mode 100755 index a699bf2d..00000000 --- a/tests/stratum-overlap-warns.setup +++ /dev/null @@ -1,117 +0,0 @@ -#!/bin/sh -# -# If a stratum has multiple chunks that have the same files in them, -# then this should be notified -# -# Copyright (C) 2011, 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 - -chunkrepo="$DATADIR/chunk-repo" -morphsrepo="$DATADIR/morphs-repo" - -cd "$morphsrepo" -git checkout --quiet -b overlap master -cat <overlap-stratum.morph -{ - "name": "overlap-stratum", - "kind": "stratum", - "chunks": [ - { - "name": "dirs", - "repo": "test:chunk-repo", - "ref": "overlap", - "build-depends": [] - }, - { - "name": "overlap-foobar", - "repo": "test:chunk-repo", - "ref": "overlap", - "build-depends": ["dirs"] - }, - { - "name": "overlap-fooqux", - "repo": "test:chunk-repo", - "ref": "overlap", - "build-depends": ["overlap-foobar"] - }, - { - "name": "overlap-foo-baz", - "repo": "test:chunk-repo", - "ref": "overlap", - "build-depends": ["overlap-fooqux"] - } - ] -} -EOF -git add overlap-stratum.morph -git commit --quiet -m "add overlapping stratum" - -cd "$chunkrepo" -git checkout --quiet -b overlap master - -cat <dirs.morph -{ - "name": "dirs", - "kind": "chunk", - "install-commands": [ - "mkdir -p \$DESTDIR/bin", - "ln -s / \$DESTDIR/usr" - ] -} -EOF -git add dirs.morph - -cat <overlap-foo-baz.morph -{ - "name": "overlap-foo-baz", - "kind": "chunk", - "install-commands": [ - "mkdir -p \$DESTDIR/bin", - "for f in foo bar baz; do echo echo \$f >\$DESTDIR/bin/\$f; done" - ] -} -EOF -git add overlap-foo-baz.morph - -cat <overlap-foobar.morph -{ - "name": "overlap-foobar", - "kind": "chunk", - "install-commands": [ - "mkdir -p \$DESTDIR/usr/bin \$DESTDIR/bin", - "echo echo foobar >\$DESTDIR/usr/bin/foobar", - "ln -s /usr/bin/foobar \$DESTDIR/bin/foo", - "ln -s /usr/bin/foobar \$DESTDIR/bin/bar" - ] -} -EOF -git add overlap-foobar.morph - -cat <overlap-fooqux.morph -{ - "name": "overlap-fooqux", - "kind": "chunk", - "install-commands": [ - "mkdir -p \$DESTDIR/usr/bin \$DESTDIR/bin", - "for f in qux fooqux; do echo echo \$f >\$DESTDIR/usr/bin/\$f; done", - "ln -s /usr/bin/fooqux \$DESTDIR/bin/foo" - ] -} -EOF -git add overlap-fooqux.morph - -git commit --quiet -m 'Add overlapping chunks' diff --git a/tests/stratum-overlap-writes-overlap.script b/tests/stratum-overlap-writes-overlap.script deleted file mode 100755 index a52d1ba7..00000000 --- a/tests/stratum-overlap-writes-overlap.script +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2011, 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. - - -## If a stratum has multiple chunks that have the same files in them, -## then the overlaps must be written to the cache - -set -eu - -cache="$DATADIR/cache/artifacts" - - -"$SRCDIR/scripts/test-morph" build-morphology \ - test:morphs-repo overlap overlap-stratum > /dev/null -"$SRCDIR/scripts/list-overlaps" groups \ - "$cache"/*.stratum.overlap-stratum.overlaps | -while IFS='\n' read overlaps; do - echo $overlaps - "$SRCDIR/scripts/list-overlaps" list-files \ - "$cache"/*.stratum.overlap-stratum.overlaps $overlaps -done diff --git a/tests/stratum-overlap-writes-overlap.setup b/tests/stratum-overlap-writes-overlap.setup deleted file mode 120000 index 255e9a74..00000000 --- a/tests/stratum-overlap-writes-overlap.setup +++ /dev/null @@ -1 +0,0 @@ -stratum-overlap-warns.setup \ No newline at end of file diff --git a/tests/stratum-overlap-writes-overlap.stdout b/tests/stratum-overlap-writes-overlap.stdout deleted file mode 100644 index 40485659..00000000 --- a/tests/stratum-overlap-writes-overlap.stdout +++ /dev/null @@ -1,4 +0,0 @@ -overlap-foo-baz overlap-foobar overlap-fooqux -bin/foo -overlap-foo-baz overlap-foobar -bin/bar diff --git a/tests/uses-tempdir.script b/tests/uses-tempdir.script deleted file mode 100755 index a4aac557..00000000 --- a/tests/uses-tempdir.script +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2011, 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. - - -## Test that temporary directories are created in the dir specified -## by --tempdir rather than specified in the environment by TMPDIR. - -set -eu -export TMPDIR -TMPDIR="$DATADIR"/unwritable-tmp -install -m 000 -d "$TMPDIR" -mkdir "$DATADIR"/tmp -"$SRCDIR/scripts/test-morph" build-morphology --tempdir "$DATADIR"/tmp \ - test:morphs-repo master hello-stratum -- cgit v1.2.1