From 70564c6457b732e1dd35384971da5df3c5a1665b Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Wed, 14 Nov 2012 16:51:48 +0000 Subject: Tidy up command tests Be consistent about placement of test description, blank lines, etc. --- tests/build-chunk-failures-dump-log.script | 11 ++++++----- tests/build-chunk-writes-log.script | 11 ++++++----- tests/build-chunk.script | 11 ++++++----- tests/build-stratum-with-submodules.script | 11 ++++++----- tests/build-stratum.script | 11 ++++++----- ...build-system-autotools-fails-if-autogen-fails.script | 12 ++++++------ tests/build-system-autotools.script | 12 ++++++------ tests/build-system-cpan.script | 11 ++++++----- tests/build-system-python-distutils.script | 10 +++++----- tests/missing-ref.script | 11 ++++++----- tests/morphless-chunks.script | 11 ++++++----- tests/name-clash.script | 17 +++++++++-------- tests/rebuild-cached-stratum.script | 17 +++++++++-------- tests/show-dependencies.script | 11 ++++++----- tests/stratum-overlap-warns.script | 13 +++++++------ tests/stratum-overlap-writes-overlap.script | 13 +++++++------ tests/trove-prefix.script | 5 +++-- tests/update-gits-chunk.script | 11 ++++++----- tests/update-gits-stratum.script | 11 ++++++----- tests/update-gits-submodules.script | 11 ++++++----- tests/uses-tempdir.script | 13 +++++++------ 21 files changed, 131 insertions(+), 113 deletions(-) (limited to 'tests') diff --git a/tests/build-chunk-failures-dump-log.script b/tests/build-chunk-failures-dump-log.script index 05a3bd8a..3e0985d8 100755 --- a/tests/build-chunk-failures-dump-log.script +++ b/tests/build-chunk-failures-dump-log.script @@ -1,22 +1,23 @@ #!/bin/bash # -# Test building a chunk. -# # 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" diff --git a/tests/build-chunk-writes-log.script b/tests/build-chunk-writes-log.script index e34914df..a258bf99 100755 --- a/tests/build-chunk-writes-log.script +++ b/tests/build-chunk-writes-log.script @@ -1,22 +1,23 @@ #!/bin/sh # -# Test building a chunk. -# # 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 diff --git a/tests/build-chunk.script b/tests/build-chunk.script index e69515b3..9728f939 100755 --- a/tests/build-chunk.script +++ b/tests/build-chunk.script @@ -1,22 +1,23 @@ #!/bin/sh # -# Test building a chunk. -# # 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 diff --git a/tests/build-stratum-with-submodules.script b/tests/build-stratum-with-submodules.script index 2a99b12d..1799d74a 100755 --- a/tests/build-stratum-with-submodules.script +++ b/tests/build-stratum-with-submodules.script @@ -1,22 +1,23 @@ #!/bin/sh # -# Test build a stratum that uses a chunk which needs a submodule. -# # 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 diff --git a/tests/build-stratum.script b/tests/build-stratum.script index d4909e9a..ac210129 100755 --- a/tests/build-stratum.script +++ b/tests/build-stratum.script @@ -1,22 +1,23 @@ #!/bin/sh # -# Test build a simple stratum. -# # 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 \ diff --git a/tests/build-system-autotools-fails-if-autogen-fails.script b/tests/build-system-autotools-fails-if-autogen-fails.script index fb80fc72..46510516 100755 --- a/tests/build-system-autotools-fails-if-autogen-fails.script +++ b/tests/build-system-autotools-fails-if-autogen-fails.script @@ -1,24 +1,24 @@ #!/bin/sh # -# Test that the autotools build system fails if it runs autogen.sh and that -# fails. -# # 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" diff --git a/tests/build-system-autotools.script b/tests/build-system-autotools.script index f23eb04e..6037d1b5 100755 --- a/tests/build-system-autotools.script +++ b/tests/build-system-autotools.script @@ -1,24 +1,24 @@ #!/bin/sh # -# Convert the hello-chunk project to something autotools-like, then -# build it. -# # 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" diff --git a/tests/build-system-cpan.script b/tests/build-system-cpan.script index aec91873..9217ab16 100755 --- a/tests/build-system-cpan.script +++ b/tests/build-system-cpan.script @@ -1,22 +1,23 @@ #!/bin/sh # -# Convert the hello-chunk project to perl with CPAN -# # 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" diff --git a/tests/build-system-python-distutils.script b/tests/build-system-python-distutils.script index d7be93bd..683599f2 100755 --- a/tests/build-system-python-distutils.script +++ b/tests/build-system-python-distutils.script @@ -1,23 +1,23 @@ #!/bin/sh # -# Convert the hello-chunk project to python with distutils -# # 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" diff --git a/tests/missing-ref.script b/tests/missing-ref.script index 2da9fa05..26183af3 100755 --- a/tests/missing-ref.script +++ b/tests/missing-ref.script @@ -1,22 +1,23 @@ #!/bin/sh # -# Test building with a bad reference. -# # 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/morphless-chunks.script b/tests/morphless-chunks.script index 315f42ea..d7b068da 100755 --- a/tests/morphless-chunks.script +++ b/tests/morphless-chunks.script @@ -1,23 +1,24 @@ #!/bin/sh -# Try to build a morphless chunk. +# # 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 +## Try to build a morphless chunk. +set -eu # Create an auto-detectable chunk. diff --git a/tests/name-clash.script b/tests/name-clash.script index 9a3e942b..b1df563c 100755 --- a/tests/name-clash.script +++ b/tests/name-clash.script @@ -1,25 +1,26 @@ #!/bin/sh # -# Test when there are two chunks with the same "name" set in the morphology -# cause only the first built to be used -# This can cause build failures when the wrong name is set and could be -# a vector for including dodgy data in a system -# # 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. + +## When there are two chunks with the same "name" set in the morphology, +## only the first built should be used. This can cause build failures when +## the wrong name is set and could be a vector for including dodgy data in +## a system. + set -eu ( cd "$DATADIR/chunk-repo" diff --git a/tests/rebuild-cached-stratum.script b/tests/rebuild-cached-stratum.script index 2615fb30..70cc54cf 100755 --- a/tests/rebuild-cached-stratum.script +++ b/tests/rebuild-cached-stratum.script @@ -1,25 +1,26 @@ #!/bin/sh # -# 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. -# # 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" diff --git a/tests/show-dependencies.script b/tests/show-dependencies.script index aad036e9..056b81b2 100755 --- a/tests/show-dependencies.script +++ b/tests/show-dependencies.script @@ -1,22 +1,23 @@ #!/bin/bash # -# Test "show-dependencies" subcommand. -# # 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 "show-dependencies" subcommand. + set -eu "$SRCDIR/scripts/test-morph" \ diff --git a/tests/stratum-overlap-warns.script b/tests/stratum-overlap-warns.script index 8cf1606c..c9aeed72 100755 --- a/tests/stratum-overlap-warns.script +++ b/tests/stratum-overlap-warns.script @@ -1,23 +1,24 @@ #!/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. + +## If a stratum has multiple chunks that have the same files in them, +## then this should be noted. + set -eu log="$DATADIR/morph.log" diff --git a/tests/stratum-overlap-writes-overlap.script b/tests/stratum-overlap-writes-overlap.script index d06b4677..a52d1ba7 100755 --- a/tests/stratum-overlap-writes-overlap.script +++ b/tests/stratum-overlap-writes-overlap.script @@ -1,23 +1,24 @@ #!/bin/sh # -# If a stratum has multiple chunks that have the same files in them, -# then the overlaps must be written to the cache -# # 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" diff --git a/tests/trove-prefix.script b/tests/trove-prefix.script index 612311f3..0f8cee3f 100755 --- a/tests/trove-prefix.script +++ b/tests/trove-prefix.script @@ -1,7 +1,5 @@ #!/bin/sh # -# Verify that trove-prefix (and by corollary trove-host) work properly. -# # Copyright (C) 2012 Codethink Limited # # This program is free software; you can redistribute it and/or modify @@ -17,6 +15,9 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +## Verify that trove-prefix (and by corollary trove-host) work properly. + set -eu RAWDUMP="$DATADIR/raw-configdump" diff --git a/tests/update-gits-chunk.script b/tests/update-gits-chunk.script index 55bdebd0..c2ad08d0 100755 --- a/tests/update-gits-chunk.script +++ b/tests/update-gits-chunk.script @@ -1,22 +1,23 @@ #!/bin/bash # # 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 'morph update-gits' updates every chunk listed on the -# command line. + +## Test that 'morph update-gits' updates every chunk listed on the +## command line. set -eu diff --git a/tests/update-gits-stratum.script b/tests/update-gits-stratum.script index 04511563..112a8973 100755 --- a/tests/update-gits-stratum.script +++ b/tests/update-gits-stratum.script @@ -1,22 +1,23 @@ #!/bin/bash # # 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 'morph update-gits' updates every chunk that depends on the -# strata listed on the command line. + +## Test that 'morph update-gits' updates every chunk that depends on the +## strata listed on the command line. set -eu diff --git a/tests/update-gits-submodules.script b/tests/update-gits-submodules.script index ad5f220c..66d35897 100755 --- a/tests/update-gits-submodules.script +++ b/tests/update-gits-submodules.script @@ -1,22 +1,23 @@ #!/bin/bash # # 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 'morph update-gits' caches all the submodules needed by -# a chunk. + +## Test that 'morph update-gits' caches all the submodules needed by +## a chunk. set -eu diff --git a/tests/uses-tempdir.script b/tests/uses-tempdir.script index 328413dd..a4aac557 100755 --- a/tests/uses-tempdir.script +++ b/tests/uses-tempdir.script @@ -1,23 +1,24 @@ #!/bin/sh # -# Test that temporary directories are created in the dir specified -# by --tempdir rather than specified in the environment by TMPDIR. -# # 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 -- cgit v1.2.1