From bba1d9e9f17edf885e857d0ddcf5b6f41e956b10 Mon Sep 17 00:00:00 2001 From: Adam Coldrick Date: Fri, 8 Aug 2014 11:10:25 +0000 Subject: cmdtests: Use YAML not JSON to represent morphologies --- tests.as-root/archless-system-fails.script | 15 +- .../metadata-includes-morph-version.setup | 19 +- tests.as-root/metadata-includes-repo-alias.setup | 19 +- .../rootfs-tarball-builds-rootfs-and-kernel.script | 13 +- tests.as-root/system-overlap.script | 132 +++--- tests.as-root/tarball-image-is-sensible.setup | 63 ++- tests.build/build-chunk-failures-dump-log.script | 17 +- tests.build/build-stratum-with-submodules.script | 34 +- tests.build/build-system-autotools.script | 10 +- tests.build/build-system-cmake.script | 11 +- tests.build/build-system-cpan.script | 31 +- tests.build/build-system-python-distutils.script | 31 +- tests.build/build-system-qmake.script | 13 +- tests.build/empty-stratum.script | 6 +- tests.build/prefix.script | 62 ++- tests.build/setup | 58 +-- tests.build/setup-build-essential | 122 +++--- tests.build/stratum-overlap-warns.setup | 120 +++--- tests.deploy/setup | 128 +++--- tests/setup | 60 +-- tests/show-dependencies.setup | 452 ++++++++------------- 21 files changed, 549 insertions(+), 867 deletions(-) diff --git a/tests.as-root/archless-system-fails.script b/tests.as-root/archless-system-fails.script index c5c423b4..e34e9ad6 100755 --- a/tests.as-root/archless-system-fails.script +++ b/tests.as-root/archless-system-fails.script @@ -23,17 +23,10 @@ set -eu cd "$DATADIR/morphs" git checkout --quiet -b archless master cat <archless-system.morph -{ - "name": "archless-system", - "kind": "system", - "strata": [ - { - "morph": "hello-stratum", - "repo": "tests:morphs", - "ref": "archless" - } - ] -} +name: archless-system +kind: system +strata: + - morph: hello-stratum EOF git add archless-system.morph git commit --quiet -m "add archless system" diff --git a/tests.as-root/metadata-includes-morph-version.setup b/tests.as-root/metadata-includes-morph-version.setup index d7fc96e3..e4557302 100755 --- a/tests.as-root/metadata-includes-morph-version.setup +++ b/tests.as-root/metadata-includes-morph-version.setup @@ -24,19 +24,12 @@ morphsrepo="$DATADIR/morphs" cd "$morphsrepo" git checkout -b tarball cat < hello-tarball.morph -{ - "name": "hello-tarball", - "kind": "system", - "arch": "$("$SRCDIR/scripts/test-morph" print-architecture)", - "strata": [ - { - "morph": "hello-stratum", - }, - { - "morph": "linux-stratum", - } - ] -} +name: hello-tarball +kind: system +arch: $("$SRCDIR/scripts/test-morph" print-architecture) +strata: + - morph: hello-stratum + - morph: linux-stratum EOF git add hello-tarball.morph diff --git a/tests.as-root/metadata-includes-repo-alias.setup b/tests.as-root/metadata-includes-repo-alias.setup index d7fc96e3..e4557302 100755 --- a/tests.as-root/metadata-includes-repo-alias.setup +++ b/tests.as-root/metadata-includes-repo-alias.setup @@ -24,19 +24,12 @@ morphsrepo="$DATADIR/morphs" cd "$morphsrepo" git checkout -b tarball cat < hello-tarball.morph -{ - "name": "hello-tarball", - "kind": "system", - "arch": "$("$SRCDIR/scripts/test-morph" print-architecture)", - "strata": [ - { - "morph": "hello-stratum", - }, - { - "morph": "linux-stratum", - } - ] -} +name: hello-tarball +kind: system +arch: $("$SRCDIR/scripts/test-morph" print-architecture) +strata: + - morph: hello-stratum + - morph: linux-stratum EOF git add hello-tarball.morph diff --git a/tests.as-root/rootfs-tarball-builds-rootfs-and-kernel.script b/tests.as-root/rootfs-tarball-builds-rootfs-and-kernel.script index e0829968..ca1b1302 100755 --- a/tests.as-root/rootfs-tarball-builds-rootfs-and-kernel.script +++ b/tests.as-root/rootfs-tarball-builds-rootfs-and-kernel.script @@ -27,14 +27,11 @@ arch=$("$SRCDIR/scripts/test-morph" print-architecture) cd "$DATADIR/kernel-repo" cat <linux.morph -{ - "name": "linux", - "kind": "chunk", - "install-commands": [ - "mkdir -p \"\$DESTDIR/boot\"", - "touch \"\$DESTDIR\"/boot/zImage" - ] -} +name: linux +kind: chunk +install-commands: + - mkdir -p "\$DESTDIR/boot" + - touch "\$DESTDIR/boot/zImage" EOF git add linux.morph git commit --quiet -m 'Make the kernel create a dummy zImage' diff --git a/tests.as-root/system-overlap.script b/tests.as-root/system-overlap.script index 1ce8379d..9be6df13 100755 --- a/tests.as-root/system-overlap.script +++ b/tests.as-root/system-overlap.script @@ -28,63 +28,44 @@ morphsrepo="$DATADIR/morphs" cd "$morphsrepo" git checkout --quiet -b overlap master cat <overlap-system.morph -{ - "name": "overlap-system", - "kind": "system", - "arch": "$("$SRCDIR/scripts/test-morph" print-architecture)", - "strata": [ - { - "morph": "foo-baz-stratum", - }, - { - "morph": "foo-barqux-stratum", - } - ] -} +name: overlap-system +kind: system +arch: $("$SRCDIR/scripts/test-morph" print-architecture) +strata: + - morph: foo-baz-stratum + - morph: foo-barqux-stratum EOF cat <foo-baz-stratum.morph -{ - "name": "foo-baz-stratum", - "kind": "stratum", - "chunks": [ - { - "name": "overlap-foo-baz", - "repo": "test:chunk-repo", - "ref": "overlap", - "build-mode": "test", - "build-depends": [] - }, - { - "name": "linux", - "repo": "test:kernel-repo", - "ref": "master", - "build-mode": "test", - "build-depends": ["overlap-foo-baz"] - } - ] -} +name: foo-baz-stratum +kind: stratum +chunks: + - name: overlap-foo-baz + repo: test:chunk-repo + ref: overlap + build-mode: test + build-depends: [] + - name: linux + repo: test:kernel-repo + ref: master + build-mode: test + build-depends: + - overlap-foo-baz EOF cat <foo-barqux-stratum.morph -{ - "name": "foo-barqux-stratum", - "kind": "stratum", - "chunks": [ - { - "name": "overlap-foobar", - "repo": "test:chunk-repo", - "ref": "overlap", - "build-mode": "test", - "build-depends": [] - }, - { - "name": "overlap-fooqux", - "repo": "test:chunk-repo", - "ref": "overlap", - "build-mode": "test", - "build-depends": ["overlap-foobar"] - } - ] -} +name: foo-barqux-stratum +kind: stratum +chunks: + - name: overlap-foobar + repo: test:chunk-repo + ref: overlap + build-mode: test + build-depends: [] + - name: overlap-fooqux + repo: test:chunk-repo + ref: overlap + build-mode: test + build-depends: + - overlap-foobar EOF git add overlap-system.morph foo-baz-stratum.morph foo-barqux-stratum.morph git commit --quiet -m "add overlapping system" @@ -92,39 +73,30 @@ git commit --quiet -m "add overlapping system" cd "$chunkrepo" git checkout --quiet -b overlap master 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" - ] -} +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 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" - ] -} +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 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" - ] -} +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-*.morph diff --git a/tests.as-root/tarball-image-is-sensible.setup b/tests.as-root/tarball-image-is-sensible.setup index c47a5336..a687b691 100755 --- a/tests.as-root/tarball-image-is-sensible.setup +++ b/tests.as-root/tarball-image-is-sensible.setup @@ -24,17 +24,14 @@ chunkrepo="$DATADIR/chunk-repo" cd "$chunkrepo" git checkout -b tarball-links cat >links.morph <<'EOF' -{ - "name": "links", - "kind": "chunk", - "build-system": "manual", - "install-commands": [ - "mkdir -p \"$DESTDIR/bin\"", - "touch \"$DESTDIR/bin/true\"", - "cd \"$DESTDIR/bin\" && ln true true-hardlink", - "cd \"$DESTDIR/bin\" && ln -s true true-symlink" - ] -} +name: links +kind: chunk +build-system: manual +install-commands: + - mkdir -p "$DESTDIR/bin" + - touch "$DESTDIR/bin/true" + - cd "$DESTDIR/bin" && ln true true-hardlink + - cd "$DESTDIR/bin" && ln -s true true-symlink EOF git add links.morph git commit --quiet -m 'Add link adding chunk' @@ -43,22 +40,13 @@ morphsrepo="$DATADIR/morphs" cd "$morphsrepo" git checkout -b tarball-links cat < hello-tarball.morph -{ - "name": "hello-tarball", - "kind": "system", - "arch": "$("$SRCDIR/scripts/test-morph" print-architecture)", - "strata": [ - { - "morph": "link-stratum", - }, - { - "morph": "hello-stratum", - }, - { - "morph": "linux-stratum", - } - ] -} +name: hello-tarball +kind: system +arch: $("$SRCDIR/scripts/test-morph" print-architecture) +strata: + - morph: link-stratum + - morph: hello-stratum + - morph: linux-stratum EOF git add hello-tarball.morph @@ -69,19 +57,14 @@ sed -i linux-stratum.morph \ git add linux-stratum.morph cat < link-stratum.morph -{ - "name": "link-stratum", - "kind": "stratum", - "chunks": [ - { - "name": "links", - "repo": "test:chunk-repo", - "ref": "tarball-links", - "build-mode": "test", - "build-depends": [] - } - ] -} +name: link-stratum +kind: stratum +chunks: + - name: links + repo: test:chunk-repo + ref: tarball-links + build-mode: test + build-depends: [] EOF git add link-stratum.morph git commit --quiet -m "add morphs" diff --git a/tests.build/build-chunk-failures-dump-log.script b/tests.build/build-chunk-failures-dump-log.script index e5c7c38d..645fd59a 100755 --- a/tests.build/build-chunk-failures-dump-log.script +++ b/tests.build/build-chunk-failures-dump-log.script @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (C) 2011-2013 Codethink Limited +# Copyright (C) 2011-2014 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 @@ -25,15 +25,12 @@ chunkrepo="$DATADIR/chunk-repo" cd "$chunkrepo" git checkout --quiet farrokh cat <hello.morph -{ - "name": "hello", - "kind": "chunk", - "build-system": "dummy", - "build-commands": [ - "echo The next command will fail", - "false" - ] -} +name: hello +kind: chunk +build-system: dummy +build-commands: + - echo The next command will fail + - "false" EOF git add hello.morph git commit --quiet -m "Make morphology fail to build." diff --git a/tests.build/build-stratum-with-submodules.script b/tests.build/build-stratum-with-submodules.script index c996e769..015db3f2 100755 --- a/tests.build/build-stratum-with-submodules.script +++ b/tests.build/build-stratum-with-submodules.script @@ -26,14 +26,11 @@ set -eu parent="$DATADIR/parent-repo" mkdir "$parent" cat < "$parent/parent.morph" -{ - "name": "parent", - "kind": "chunk", - "build-system": "manual", - "build-commands": [ - "test -f le-sub/README" - ] -} +name: parent +kind: chunk +build-system: manual +build-commands: + - test -f le-sub/README EOF "$SRCDIR/scripts/run-git-in" "$parent" init --quiet @@ -47,19 +44,14 @@ EOF morphs="$DATADIR/morphs-repo" cat < "$morphs/hello-stratum.morph" -{ - "name": "hello-stratum", - "kind": "stratum", - "chunks": [ - { - "name": "parent", - "repo": "test:parent-repo", - "ref": "master", - "build-depends": [], - "build-mode": "test" - } - ] -} +name: hello-stratum +kind: stratum +chunks: + - name: parent + repo: test:parent-repo + ref: master + build-depends: [] + build-mode: test EOF "$SRCDIR/scripts/run-git-in" "$morphs" add hello-stratum.morph "$SRCDIR/scripts/run-git-in" "$morphs" commit --quiet -m 'foo' diff --git a/tests.build/build-system-autotools.script b/tests.build/build-system-autotools.script index ba5cd32f..2ea53174 100755 --- a/tests.build/build-system-autotools.script +++ b/tests.build/build-system-autotools.script @@ -37,12 +37,10 @@ EOF git add Makefile cat < hello.morph -{ - "name": "hello", - "kind": "chunk", - "build-system": "autotools", - "configure-commands": [] -} +name: hello +kind: chunk +build-system: autotools +configure-commands: [] EOF git add hello.morph git commit --quiet -m "Convert hello to an autotools project" diff --git a/tests.build/build-system-cmake.script b/tests.build/build-system-cmake.script index ab5186d7..570a9af7 100755 --- a/tests.build/build-system-cmake.script +++ b/tests.build/build-system-cmake.script @@ -38,12 +38,11 @@ EOF git add CMakeLists.txt cat < hello.morph -{ - "name": "hello", - "kind": "chunk", - "build-system": "cmake", - "install-commands": ["make DESTDIR=\"\$DESTDIR\" install"] -} +name: hello +kind: chunk +build-system: cmake +install-commands: + - make DESTDIR="\$DESTDIR" install EOF git add hello.morph git commit --quiet -m "Convert hello to a cmake project" diff --git a/tests.build/build-system-cpan.script b/tests.build/build-system-cpan.script index f66d4027..735dac84 100755 --- a/tests.build/build-system-cpan.script +++ b/tests.build/build-system-cpan.script @@ -44,11 +44,9 @@ EOF git add Makefile.PL cat <hello.morph -{ - "name": "hello", - "kind": "chunk", - "build-system": "cpan" -} +name: hello +kind: chunk +build-system: cpan EOF git add hello.morph @@ -57,20 +55,15 @@ git commit --quiet -m 'convert hello into a perl cpan project' # Set 'prefix' of hello to something custom cd "$DATADIR/morphs-repo" cat < hello-stratum.morph -{ - "name": "hello-stratum", - "kind": "stratum", - "chunks": [ - { - "name": "hello", - "repo": "test:chunk-repo", - "ref": "farrokh", - "build-depends": [], - "build-mode": "test", - "prefix": "/" - } - ] -} +name: hello-stratum +kind: stratum +chunks: + - name: hello + repo: test:chunk-repo + ref: farrokh + build-depends: [] + build-mode: test + prefix: / EOF git add hello-stratum.morph git commit -q -m "Set custom install prefix for hello" diff --git a/tests.build/build-system-python-distutils.script b/tests.build/build-system-python-distutils.script index e1dccb4b..9a751491 100755 --- a/tests.build/build-system-python-distutils.script +++ b/tests.build/build-system-python-distutils.script @@ -41,11 +41,9 @@ EOF git add setup.py cat <hello.morph -{ - "name": "hello", - "kind": "chunk", - "build-system": "python-distutils" -} +name: hello +kind: chunk +build-system: python-distutils EOF git add hello.morph @@ -55,20 +53,15 @@ git commit --quiet -m 'convert hello into a python project' # Set 'prefix' of hello to something custom cd "$DATADIR/morphs-repo" cat < hello-stratum.morph -{ - "name": "hello-stratum", - "kind": "stratum", - "chunks": [ - { - "name": "hello", - "repo": "test:chunk-repo", - "ref": "farrokh", - "build-depends": [], - "build-mode": "test", - "prefix": "" - } - ] -} +name: hello-stratum +kind: stratum +chunks: + - name: hello + repo: test:chunk-repo + ref: farrokh + build-depends: [] + build-mode: test + prefix: "" EOF git add hello-stratum.morph git commit -q -m "Set custom install prefix for hello" diff --git a/tests.build/build-system-qmake.script b/tests.build/build-system-qmake.script index d9e21fba..b3861936 100755 --- a/tests.build/build-system-qmake.script +++ b/tests.build/build-system-qmake.script @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (C) 2011-2013 Codethink Limited +# Copyright (C) 2011-2014 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 @@ -46,12 +46,11 @@ EOF git add hello.pro cat < hello.morph -{ - "name": "hello", - "kind": "chunk", - "build-system": "qmake", - "install-commands": ["make INSTALL_ROOT=\"\$DESTDIR\" install"] -} +name: hello +kind: chunk +build-system: qmake +install-commands: + - make INSTALL_ROOT="\$DESTDIR" install EOF git add hello.morph git commit --quiet -m "Convert hello to an qmake project" diff --git a/tests.build/empty-stratum.script b/tests.build/empty-stratum.script index cb39b94a..19c36558 100755 --- a/tests.build/empty-stratum.script +++ b/tests.build/empty-stratum.script @@ -24,10 +24,8 @@ git checkout --quiet -b empty-stratum # Create empty stratum to test S4585 cat < hello-stratum.morph -{ - "name": "hello-stratum", - "kind": "stratum" -} +name: hello-stratum +kind: stratum EOF sed -i 's/master/empty-stratum/' hello-system.morph git add hello-stratum.morph hello-system.morph diff --git a/tests.build/prefix.script b/tests.build/prefix.script index ca9648c9..209c1a54 100755 --- a/tests.build/prefix.script +++ b/tests.build/prefix.script @@ -24,24 +24,18 @@ set -eu cd "$DATADIR/chunk-repo" git checkout -q master cat <<\EOF > xyzzy.morph -{ - "name": "xyzzy", - "kind": "chunk", - "configure-commands": [ - "echo First chunk: prefix $PREFIX" - ] -} +name: xyzzy +kind: chunk +configure-commands: + - "echo First chunk: prefix $PREFIX" EOF cat <<\EOF > plugh.morph -{ - "name": "plugh", - "kind": "chunk", - "configure-commands": [ - "echo Second chunk: prefix $PREFIX", - "echo Path: $(echo $PATH | grep -o '/plover')" - ] -} +name: plugh +kind: chunk +configure-commands: + - "echo Second chunk: prefix $PREFIX" + - "echo Path: $(echo $PATH | grep -o '/plover')" EOF git add xyzzy.morph @@ -51,29 +45,21 @@ git commit -q -m "Add chunks" # Change stratum to include those two chunks, and use a custom install prefix cd "$DATADIR/morphs-repo" cat < hello-stratum.morph -{ - "name": "hello-stratum", - "kind": "stratum", - "chunks": [ - { - "name": "xyzzy", - "repo": "test:chunk-repo", - "ref": "master", - "build-depends": [], - "build-mode": "test", - "prefix": "/plover" - }, - { - "name": "plugh", - "repo": "test:chunk-repo", - "ref": "master", - "build-mode": "test", - "build-depends": [ - "xyzzy" - ] - } - ] -} +name: hello-stratum +kind: stratum +chunks: + - name: xyzzy + repo: test:chunk-repo + ref: master + build-depends: [] + build-mode: test + prefix: /plover + - name: plugh + repo: test:chunk-repo + ref: master + build-mode: test + build-depends: + - xyzzy EOF git add hello-stratum.morph git commit -q -m "Update stratum" diff --git a/tests.build/setup b/tests.build/setup index 559825b1..833f132d 100755 --- a/tests.build/setup +++ b/tests.build/setup @@ -57,19 +57,15 @@ EOF git add hello.c cat < hello.morph -{ - "name": "hello", - "kind": "chunk", - "build-system": "dummy", - "build-commands": [ - "gcc -o hello hello.c" - ], - "install-commands": [ - "install -d \\"\$DESTDIR\\"/etc", - "install -d \\"\$DESTDIR\\"/bin", - "install hello \\"\$DESTDIR\\"/bin/hello" - ] -} +name: hello +kind: chunk +build-system: dummy +build-commands: + - gcc -o hello hello.c +install-commands: + - install -d "\$DESTDIR"/etc + - install -d "\$DESTDIR"/bin + - install hello "\$DESTDIR"/bin/hello EOF git add hello.morph @@ -87,33 +83,23 @@ cd "$morphsrepo" git init --quiet cat < hello-stratum.morph -{ - "name": "hello-stratum", - "kind": "stratum", - "chunks": [ - { - "name": "hello", - "repo": "test:chunk-repo", - "ref": "farrokh", - "build-mode": "test", - "build-depends": [] - } - ] -} +name: hello-stratum +kind: stratum +chunks: + - name: hello + repo: test:chunk-repo + ref: farrokh + build-mode: test + build-depends: [] EOF git add hello-stratum.morph cat < hello-system.morph -{ - "name": "hello-system", - "kind": "system", - "arch": "$("$SRCDIR/scripts/test-morph" print-architecture)", - "strata": [ - { - "morph": "hello-stratum", - } - ] -} +name: hello-system +kind: system +arch: $("$SRCDIR/scripts/test-morph" print-architecture) +strata: + - morph: hello-stratum EOF git add hello-system.morph diff --git a/tests.build/setup-build-essential b/tests.build/setup-build-essential index 5674020d..9ffb7774 100755 --- a/tests.build/setup-build-essential +++ b/tests.build/setup-build-essential @@ -28,28 +28,21 @@ EOF chmod +x morph-test-cc cat < "stage1-cc.morph" -{ - "name": "stage1-cc", - "kind": "chunk", - "install-commands": [ - "install -d \"\$DESTDIR\$PREFIX/bin\"", - "install -m 755 morph-test-cc \"\$DESTDIR\$PREFIX/bin/morph-test-cc\"" - ] -} +name: stage1-cc +kind: chunk +install-commands: + - install -d "\$DESTDIR\$PREFIX/bin" + - install -m 755 morph-test-cc "\$DESTDIR\$PREFIX/bin/morph-test-cc" EOF cat < "cc.morph" -{ - "name": "cc", - "kind": "chunk", - "configure-commands": [ - "[ -e ../tools/bin/morph-test-cc ]" - ], - "install-commands": [ - "install -d \"\$DESTDIR\$PREFIX/bin\"", - "install -m 755 morph-test-cc \"\$DESTDIR\$PREFIX/bin/morph-test-cc\"" - ] -} +name: cc +kind: chunk +configure-commands: + - [ -e ../tools/bin/morph-test-cc ] +install-commands: + - install -d "\$DESTDIR\$PREFIX/bin" + - install -m 755 morph-test-cc "\$DESTDIR\$PREFIX/bin/morph-test-cc" EOF git init -q @@ -61,21 +54,16 @@ git commit -q -m "Create compiler chunk" cd "$DATADIR/chunk-repo" git checkout -q farrokh cat < "hello.morph" -{ - "name": "hello", - "kind": "chunk", - "configure-commands": [ - "[ ! -e ../tools/bin/morph-test-cc ]", - "[ -e ../usr/bin/morph-test-cc ]" - ], - "build-commands": [ - "../usr/bin/morph-test-cc > hello" - ], - "install-commands": [ - "install -d \"\$DESTDIR\$PREFIX/bin\"", - "install hello \"\$DESTDIR\$PREFIX/bin/hello\"" - ] -} +name: hello +kind: chunk +configure-commands: + - [ ! -e ../tools/bin/morph-test-cc ] + - [ -e ../usr/bin/morph-test-cc ] +build-commands: + - ../usr/bin/morph-test-cc > hello +install-commands: + - install -d "\$DESTDIR\$PREFIX/bin" + - install hello "\$DESTDIR\$PREFIX/bin/hello" EOF git add hello.morph git commit -q -m "Make 'hello' require our mock compiler" @@ -85,50 +73,34 @@ git commit -q -m "Make 'hello' require our mock compiler" # artifact, and neither should make it into the system. cd "$DATADIR/morphs-repo" cat < "build-essential.morph" -{ - "name": "build-essential", - "kind": "stratum", - "chunks": [ - { - "name": "stage1-cc", - "repo": "test:cc-repo", - "ref": "master", - "build-depends": [], - "build-mode": "bootstrap", - "prefix": "/tools" - }, - { - "name": "cc", - "repo": "test:cc-repo", - "ref": "master", - "build-depends": [ - "stage1-cc" - ], - "build-mode": "test" - } - ] -} +name: build-essential +kind: stratum +chunks: + - name: stage1-cc + repo: test:cc-repo + ref: master + build-depends: [] + build-mode: bootstrap + prefix: /tools + - name: cc + repo: test:cc-repo + ref: master + build-depends: + - stage1-cc + build-mode: test EOF cat < "hello-stratum.morph" -{ - "name": "hello-stratum", - "kind": "stratum", - "build-depends": [ - { - "morph": "build-essential", - } - ], - "chunks": [ - { - "name": "hello", - "repo": "test:chunk-repo", - "ref": "farrokh", - "build-depends": [], - "build-mode": "test" - } - ] -} +name: hello-stratum +kind: stratum +build-depends: + - morph: build-essential +chunks: + - name: hello + repo: test:chunk-repo + ref: farrokh + build-depends: [] + build-mode: test EOF git add build-essential.morph hello-stratum.morph hello-system.morph diff --git a/tests.build/stratum-overlap-warns.setup b/tests.build/stratum-overlap-warns.setup index 5ebd217c..b969822d 100755 --- a/tests.build/stratum-overlap-warns.setup +++ b/tests.build/stratum-overlap-warns.setup @@ -3,7 +3,7 @@ # If a stratum has multiple chunks that have the same files in them, # then this should be notified # -# Copyright (C) 2011-2013 Codethink Limited +# Copyright (C) 2011-2014 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 @@ -26,40 +26,32 @@ morphsrepo="$DATADIR/morphs-repo" cd "$morphsrepo" git checkout --quiet -b overlap master cat <hello-stratum.morph -{ - "name": "hello-stratum", - "kind": "stratum", - "chunks": [ - { - "name": "dirs", - "repo": "test:chunk-repo", - "ref": "overlap", - "build-depends": [], - "build-mode": "test" - }, - { - "name": "overlap-foobar", - "repo": "test:chunk-repo", - "ref": "overlap", - "build-depends": ["dirs"], - "build-mode": "test" - }, - { - "name": "overlap-fooqux", - "repo": "test:chunk-repo", - "ref": "overlap", - "build-depends": ["overlap-foobar"], - "build-mode": "test" - }, - { - "name": "overlap-foo-baz", - "repo": "test:chunk-repo", - "ref": "overlap", - "build-depends": ["overlap-fooqux"], - "build-mode": "test" - } - ] -} +name: hello-stratum +kind: stratum +chunks: + - name: dirs + repo: test:chunk-repo + ref: overlap + build-depends: [] + build-mode: test + - name: overlap-foobar + repo: test:chunk-repo + ref: overlap + build-depends: + - dirs + build-mode: test + - name: overlap-fooqux + repo: test:chunk-repo + ref: overlap + build-depends: + - overlap-foobar + build-mode: test + - name: overlap-foo-baz + repo: test:chunk-repo + ref: overlap + build-depends: + - overlap-fooqux + build-mode: test EOF sed -i 's/master/overlap/' hello-system.morph git add hello-stratum.morph hello-system.morph @@ -69,53 +61,41 @@ 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" - ] -} +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" - ] -} +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" - ] -} +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" - ] -} +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 diff --git a/tests.deploy/setup b/tests.deploy/setup index ece8819a..033598bc 100755 --- a/tests.deploy/setup +++ b/tests.deploy/setup @@ -62,19 +62,15 @@ EOF git add hello.c cat < hello.morph -{ - "name": "hello", - "kind": "chunk", - "build-system": "dummy", - "build-commands": [ - "gcc -o hello hello.c" - ], - "install-commands": [ - "install -d \\"\$DESTDIR\\"/etc", - "install -d \\"\$DESTDIR\\"/bin", - "install hello \\"\$DESTDIR\\"/bin/hello" - ] -} +name: hello +kind: chunk +build-system: dummy +build-commands: + - gcc -o hello hello.c +install-commands: + - install -d "\$DESTDIR/etc" + - install -d "\$DESTDIR/bin" + - install hello "\$DESTDIR/bin/hello" EOF git add hello.morph @@ -92,76 +88,49 @@ cd "$morphsrepo" git init --quiet cat < hello-stratum.morph -{ - "name": "hello-stratum", - "kind": "stratum", - "chunks": [ - { - "name": "hello", - "repo": "test:chunk-repo", - "ref": "farrokh", - "build-depends": [], - "build-mode": "test" - } - ] -} +name: hello-stratum +kind: stratum +chunks: + - name: hello + repo: test:chunk-repo + ref: farrokh + build-depends: [] + build-mode: test EOF git add hello-stratum.morph cat < hello-system.morph -{ - "name": "hello-system", - "kind": "system", - "arch": "$("$SRCDIR/scripts/test-morph" print-architecture)", - "strata": [ - { - "morph": "hello-stratum", - } - ] -} +name: hello-system +kind: system +arch: $("$SRCDIR/scripts/test-morph" print-architecture) +strata: + - morph: hello-stratum EOF git add hello-system.morph cat < linux-stratum.morph -{ - "name": "linux-stratum", - "kind": "stratum", - "build-depends": [ - { - "morph": "hello-stratum", - } - ], - "chunks": [ - { - "name": "linux", - "repo": "test:kernel-repo", - "ref": "master", - "build-depends": [], - "build-mode": "test" - } - ] -} +name: linux-stratum +kind: stratum +build-depends: + - morph: hello-stratum +chunks: + - name: linux + repo: test:kernel-repo + ref: master + build-depends: [] + build-mode: test EOF git add linux-stratum.morph cat < linux-system.morph -{ - "name": "linux-system", - "kind": "system", - "arch": "$("$SRCDIR/scripts/test-morph" print-architecture)", - "strata": [ - { - "morph": "hello-stratum", - }, - { - "morph": "linux-stratum", - } - ], - "configuration-extensions": [ - set-hostname - ] - -} +name: linux-system +kind: system +arch: $("$SRCDIR/scripts/test-morph" print-architecture) +strata: + - morph: hello-stratum + - morph: linux-stratum +configuration-extensions: + - set-hostname EOF git add linux-system.morph @@ -222,16 +191,13 @@ git commit --quiet -m "add morphs" # Make a dummy kernel chunk. mkdir "$DATADIR/kernel-repo" cat < "$DATADIR/kernel-repo/linux.morph" -{ - "name": "linux", - "kind": "chunk", - "install-commands": [ - "mkdir -p \"\$DESTDIR/boot\"", - "touch \"\$DESTDIR\"/extlinux.conf", - "touch \"\$DESTDIR\"/boot/vmlinuz", - "touch \"\$DESTDIR\"/boot/System.map" - ] -} +name: linux +kind: chunk +install-commands: + - mkdir -p "\$DESTDIR/boot" + - touch "\$DESTDIR/extlinux.conf" + - touch "\$DESTDIR/boot/vmlinuz" + - touch "\$DESTDIR/boot/System.map" EOF "$SRCDIR/scripts/run-git-in" "$DATADIR/kernel-repo" init --quiet "$SRCDIR/scripts/run-git-in" "$DATADIR/kernel-repo" add . diff --git a/tests/setup b/tests/setup index 07643ddc..02ddb3af 100755 --- a/tests/setup +++ b/tests/setup @@ -10,7 +10,7 @@ # The stratum repository contains a single branch, "master", with a # stratum and a system morphology that include the chunk above. # -# Copyright (C) 2011-2013 Codethink Limited +# Copyright (C) 2011-2014 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 @@ -57,19 +57,15 @@ EOF git add hello.c cat < hello.morph -{ - "name": "hello", - "kind": "chunk", - "build-system": "dummy", - "build-commands": [ - "gcc -o hello hello.c" - ], - "install-commands": [ - "install -d \\"\$DESTDIR\\"/etc", - "install -d \\"\$DESTDIR\\"/bin", - "install hello \\"\$DESTDIR\\"/bin/hello" - ] -} +name: hello +kind: chunk +build-system: dummy +build-commands: + - gcc -o hello hello.c +install-commands: + - install -d "\$DESTDIR/etc" + - install -d "\$DESTDIR/bin" + - install hello "\$DESTDIR/bin/hello" EOF git add hello.morph @@ -87,34 +83,22 @@ cd "$morphsrepo" git init --quiet cat < hello-stratum.morph -{ - "name": "hello-stratum", - "kind": "stratum", - "chunks": [ - { - "name": "hello", - "repo": "test:chunk-repo", - "ref": "farrokh", - "build-mode": "test", - "build-depends": [] - } - ] -} +name: hello-stratum +kind: stratum +chunks: + - name: hello + repo: test:chunk-repo + ref: farrokh + build-mode: test + build-depends: [] EOF git add hello-stratum.morph cat < hello-system.morph -{ - "name": "hello-system", - "kind": "system", - "strata": [ - { - "morph": "hello-stratum", - "repo": "test:morphs-repo", - "ref": "master" - } - ] -} +name: hello-system +kind: system +strata: + - morph: hello-stratum EOF git add hello-system.morph diff --git a/tests/show-dependencies.setup b/tests/show-dependencies.setup index 510656e6..c99e90a9 100755 --- a/tests/show-dependencies.setup +++ b/tests/show-dependencies.setup @@ -42,18 +42,14 @@ gtkcomponents=(freetype fontconfig cairo pango glib gdk-pixbuf gtk for component in "${gtkcomponents[@]}" do cat < $component.morph -{ - "name": "$component", - "kind": "chunk", - "build-commands": [ - "gcc -o hello hello.c" - ], - "install-commands": [ - "install -d \\"\$DESTDIR\\"/etc", - "install -d \\"\$DESTDIR\\"/bin", - "install hello \\"\$DESTDIR\\"/bin/$component" - ] -} +name: $component +kind: chunk +build-commands: + - gcc -o hello hello.c +install-commands: + - install -d "\$DESTDIR"/etc + - install -d "\$DESTDIR"/bin + - install hello "\$DESTDIR"/bin/$component EOF git add $component.morph done @@ -61,95 +57,64 @@ git commit --quiet -m "add .c source file and GTK chunk morphologies" # Define a stratum for the GTK stack cat < gtk-stack.morph -{ - "name": "gtk-stack", - "kind": "stratum", - "build-depends": [ - ], - "chunks": [ - { - "name": "freetype", - "repo": "test:test-repo", - "ref": "master", - "build-mode": "test", - "build-depends": [ - ] - }, - { - "name": "fontconfig", - "repo": "test:test-repo", - "ref": "master", - "build-mode": "test", - "build-depends": [ - ] - }, - { - "name": "cairo", - "repo": "test:test-repo", - "ref": "master", - "build-mode": "test", - "build-depends": [ - ] - }, - { - "name": "pango", - "repo": "test:test-repo", - "ref": "master", - "build-mode": "test", - "build-depends": [ - "freetype", - "fontconfig" - ] - }, - { - "name": "glib", - "repo": "test:test-repo", - "ref": "master", - "build-mode": "test", - "build-depends": [ - ] - }, - { - "name": "gdk-pixbuf", - "repo": "test:test-repo", - "ref": "master", - "build-mode": "test", - "build-depends": [ - "glib" - ] - }, - { - "name": "gtk", - "repo": "test:test-repo", - "ref": "master", - "build-mode": "test", - "build-depends": [ - "cairo", - "gdk-pixbuf", - "glib", - "pango" - ] - }, - { - "name": "dbus", - "repo": "test:test-repo", - "ref": "master", - "build-mode": "test", - "build-depends": [ - ] - }, - { - "name": "dbus-glib", - "repo": "test:test-repo", - "ref": "master", - "build-mode": "test", - "build-depends": [ - "dbus", - "glib" - ] - } - ] -} +name: gtk-stack +kind: stratum +build-depends: [] +chunks: + - name: freetype + repo: test:test-repo + ref: master + build-mode: test + build-depends: [] + - name: fontconfig + repo: test:test-repo + ref: master + build-mode: test + build-depends: [] + - name: cairo + repo: test:test-repo + ref: master + build-mode: test + build-depends: [] + - name: pango + repo: test:test-repo + ref: master + build-mode: test + build-depends: + - freetype + - fontconfig + - name: glib + repo: test:test-repo + ref: master + build-mode: test + build-depends: [] + - name: gdk-pixbuf + repo: test:test-repo + ref: master + build-mode: test + build-depends: + - glib + - name: gtk + repo: test:test-repo + ref: master + build-mode: test + build-depends: + - cairo + - gdk-pixbuf + - glib + - pango + - name: dbus + repo: test:test-repo + ref: master + build-mode: test + build-depends: [] + - name: dbus-glib + repo: test:test-repo + ref: master + build-mode: test + build-depends: + - dbus + - glib EOF git add gtk-stack.morph git commit --quiet -m "add gtk-stack.morph stratum" @@ -172,18 +137,14 @@ xfcecomponents=(xfce4-dev-tools libxfce4util libxfce4ui exo xfconf garcon for component in "${xfcecomponents[@]}" do cat < $component.morph -{ - "name": "$component", - "kind": "chunk", - "build-commands": [ - "gcc -o hello hello.c" - ], - "install-commands": [ - "install -d \\"\$DESTDIR\\"/etc", - "install -d \\"\$DESTDIR\\"/bin", - "install hello \\"\$DESTDIR\\"/bin/$component" - ] -} +name: $component +kind: chunk +build-commands: + - gcc -o hello hello.c +install-commands: + - install -d "\$DESTDIR"/etc + - install -d "\$DESTDIR"/bin + - install hello "\$DESTDIR"/bin/$component EOF git add $component.morph done @@ -191,170 +152,117 @@ git commit --quiet -m "add .c source file and GTK chunk morphologies" # Define a stratum for the Xfce core cat < xfce-core.morph -{ - "name": "xfce-core", - "kind": "stratum", - "build-depends": [ - { - "morph": "gtk-stack", - } - ], - "chunks": [ - { - "name": "libxfce4util", - "repo": "test:test-repo", - "ref": "master", - "build-mode": "test", - "build-depends": [ - ] - }, - { - "name": "xfconf", - "repo": "test:test-repo", - "ref": "master", - "build-mode": "test", - "build-depends": [ - "libxfce4util" - ] - }, - { - "name": "libxfce4ui", - "repo": "test:test-repo", - "ref": "master", - "build-mode": "test", - "build-depends": [ - "xfconf" - ] - }, - { - "name": "exo", - "repo": "test:test-repo", - "ref": "master", - "build-mode": "test", - "build-depends": [ - "libxfce4util" - ] - }, - { - "name": "garcon", - "repo": "test:test-repo", - "ref": "master", - "build-mode": "test", - "build-depends": [ - "libxfce4util" - ] - }, - { - "name": "thunar", - "repo": "test:test-repo", - "ref": "master", - "build-mode": "test", - "build-depends": [ - "libxfce4ui", - "exo" - ] - }, - { - "name": "tumbler", - "repo": "test:test-repo", - "ref": "master", - "build-mode": "test", - "build-depends": [ - ] - }, - { - "name": "xfce4-panel", - "repo": "test:test-repo", - "ref": "master", - "build-mode": "test", - "build-depends": [ - "libxfce4ui", - "exo", - "garcon" - ] - }, - { - "name": "xfce4-settings", - "repo": "test:test-repo", - "ref": "master", - "build-mode": "test", - "build-depends": [ - "libxfce4ui", - "exo", - "xfconf" - ] - }, - { - "name": "xfce4-session", - "repo": "test:test-repo", - "ref": "master", - "build-mode": "test", - "build-depends": [ - "libxfce4ui", - "exo", - "xfconf" - ] - }, - { - "name": "xfwm4", - "repo": "test:test-repo", - "ref": "master", - "build-mode": "test", - "build-depends": [ - "libxfce4ui", - "xfconf" - ] - }, - { - "name": "xfdesktop", - "repo": "test:test-repo", - "ref": "master", - "build-mode": "test", - "build-depends": [ - "libxfce4ui", - "xfconf" - ] - }, - { - "name": "xfce4-appfinder", - "repo": "test:test-repo", - "ref": "master", - "build-mode": "test", - "build-depends": [ - "libxfce4ui", - "garcon", - "xfconf" - ] - }, - { - "name": "gtk-xfce-engine", - "repo": "test:test-repo", - "ref": "master", - "build-mode": "test", - "build-depends": [ - "libxfce4ui", - "garcon", - "xfconf" - ] - } - ] -} +name: xfce-core +kind: stratum +build-depends: + - morph: gtk-stack +chunks: + - name: libxfce4util + repo: test:test-repo + ref: master + build-mode: test + build-depends: [] + - name: xfconf + repo: test:test-repo + ref: master + build-mode: test + build-depends: + - libxfce4util + - name: libxfce4ui + repo: test:test-repo + ref: master + build-mode: test + build-depends: + - xfconf + - name: exo + repo: test:test-repo + ref: master + build-mode: test + build-depends: + - libxfce4util + - name: garcon + repo: test:test-repo + ref: master + build-mode: test + build-depends: + - libxfce4util + - name: thunar + repo: test:test-repo + ref: master + build-mode: test + build-depends: + - libxfce4ui + - exo + - name: tumbler + repo: test:test-repo + ref: master + build-mode: test + build-depends: [] + - name: xfce4-panel + repo: test:test-repo + ref: master + build-mode: test + build-depends: + - libxfce4ui + - exo + - garcon + - name: xfce4-settings + repo: test:test-repo + ref: master + build-mode: test + build-depends: + - libxfce4ui + - exo + - xfconf + - name: xfce4-session + repo: test:test-repo + ref: master + build-mode: test + build-depends: + - libxfce4ui + - exo + - xfconf + - name: xfwm4 + repo: test:test-repo + ref: master + build-mode: test + build-depends: + - libxfce4ui + - xfconf + - name: xfdesktop + repo: test:test-repo + ref: master + build-mode: test + build-depends: + - libxfce4ui + - xfconf + - name: xfce4-appfinder + repo: test:test-repo + ref: master + build-mode: test + build-depends: + - libxfce4ui + - garcon + - xfconf + - name: gtk-xfce-engine + repo: test:test-repo + ref: master + build-mode: test + build-depends: + - libxfce4ui + - garcon + - xfconf EOF git add xfce-core.morph git commit --quiet -m "add xfce-core.morph stratum" cat < xfce-system.morph -{ - "name": "xfce-system", - "kind": "system", - "arch": "$("$SRCDIR/scripts/test-morph" print-architecture)", - "strata": [ - { - "build-mode": "test", - "morph": "xfce-core" - } - ] -} +name: xfce-system +kind: system +arch: $("$SRCDIR/scripts/test-morph" print-architecture) +strata: + - build-mode: test + morph: xfce-core EOF git add xfce-system.morph git commit --quiet -m "add xfce-system" -- cgit v1.2.1