diff options
Diffstat (limited to 'tests.branching')
-rwxr-xr-x | tests.branching/add-then-edit.script | 51 | ||||
-rwxr-xr-x | tests.branching/add-then-edit.setup | 36 | ||||
-rw-r--r-- | tests.branching/add-then-edit.stdout | 1 | ||||
-rwxr-xr-x | tests.branching/branch-creates-new-system-branch.script | 37 | ||||
-rw-r--r-- | tests.branching/branch-creates-new-system-branch.stdout | 26 | ||||
-rwxr-xr-x | tests.branching/checkout-existing-branch.script | 32 | ||||
-rw-r--r-- | tests.branching/checkout-existing-branch.stdout | 13 | ||||
-rwxr-xr-x | tests.branching/edit-handles-submodules.script | 32 | ||||
-rwxr-xr-x | tests.branching/edit-handles-submodules.setup | 39 | ||||
-rwxr-xr-x | tests.branching/edit-updates-stratum.script | 31 | ||||
-rw-r--r-- | tests.branching/edit-updates-stratum.stdout | 14 | ||||
-rwxr-xr-x | tests.branching/edit-works-after-branch-root-was-renamed.script | 41 | ||||
-rw-r--r-- | tests.branching/edit-works-after-branch-root-was-renamed.stdout | 12 | ||||
-rwxr-xr-x | tests.branching/morph-repository-stored-in-cloned-repositories.script | 48 | ||||
-rw-r--r-- | tests.branching/morph-repository-stored-in-cloned-repositories.stdout | 8 |
15 files changed, 0 insertions, 421 deletions
diff --git a/tests.branching/add-then-edit.script b/tests.branching/add-then-edit.script deleted file mode 100755 index 92457cf8..00000000 --- a/tests.branching/add-then-edit.script +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2013-2015 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, see <http://www.gnu.org/licenses/>. - - -## Test the workflow of adding a new chunk to a stratum then editing it - -set -eu - -cd "$DATADIR/workspace" -"$SRCDIR/scripts/test-morph" init -"$SRCDIR/scripts/test-morph" branch test:morphs "me/add-then-edit" - -cd "me/add-then-edit" - -# add a chunk -cd test/morphs - -python -c 'import yaml -with open("hello-stratum.morph", "r") as f: - stratum = yaml.load(f) -stratum["chunks"].append({ - "build-depends": [], - "build-system": "manual", - "name": "goodbye", - "ref": "master", - "repo": "test:goodbye", -}) -with open("hello-stratum.morph", "w") as f: - yaml.dump(stratum, f) -' - -"$SRCDIR/scripts/test-morph" edit goodbye - -# check whether the stratum still contains the goodbye chunk -grep -qFe goodbye hello-stratum.morph - -# check whether edit has cloned the repository to the right branch -git --git-dir="../goodbye/.git" rev-parse --abbrev-ref HEAD diff --git a/tests.branching/add-then-edit.setup b/tests.branching/add-then-edit.setup deleted file mode 100755 index 0dc3368d..00000000 --- a/tests.branching/add-then-edit.setup +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# Copyright (C) 2013,2015 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, see <http://www.gnu.org/licenses/>. - -set -eu - -# Create goodbye chunk -mkdir "$DATADIR/goodbye" -cd "$DATADIR/goodbye" - -cat >goodbye <<'EOF' -#!/bin/sh -echo goodbye -EOF -chmod +x goodbye - -cat >goodbye.morph <<'EOF' -name: goodbye -kind: chunk -install-commands: -- install goodbye "$DESTDIR$PREFIX/bin/goodbye" -EOF -git init . -git add goodbye.morph goodbye -git commit -m "Initial commit" diff --git a/tests.branching/add-then-edit.stdout b/tests.branching/add-then-edit.stdout deleted file mode 100644 index e0950ab5..00000000 --- a/tests.branching/add-then-edit.stdout +++ /dev/null @@ -1 +0,0 @@ -me/add-then-edit diff --git a/tests.branching/branch-creates-new-system-branch.script b/tests.branching/branch-creates-new-system-branch.script deleted file mode 100755 index bc849f90..00000000 --- a/tests.branching/branch-creates-new-system-branch.script +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2012,2014-2015 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, see <http://www.gnu.org/licenses/>. - - -## Make sure "morph branch" creates a new system branch. - -set -eu - -cd "$DATADIR/workspace" -"$SRCDIR/scripts/test-morph" init - -"$SRCDIR/scripts/test-morph" branch test:morphs newbranch - -echo "File tree:" -"$SRCDIR/scripts/list-tree" . | grep -v '/\.git/' | - sed 's,/cache/gits/file_[^/]*_,/cache/gits/file_,' | - grep -v 'cache/gits/file_[^/]*/' - -echo "Current branches:" -"$SRCDIR/scripts/run-git-in" newbranch/test/morphs branch - -echo "Current origin:" -"$SRCDIR/scripts/run-git-in" newbranch/test/morphs remote show origin | - sed 's,\(TMP/workspace/\.morph/cache/gits/file_\).*_,\1,g' diff --git a/tests.branching/branch-creates-new-system-branch.stdout b/tests.branching/branch-creates-new-system-branch.stdout deleted file mode 100644 index a7318378..00000000 --- a/tests.branching/branch-creates-new-system-branch.stdout +++ /dev/null @@ -1,26 +0,0 @@ -File tree: -d . -d ./.morph -d ./newbranch -d ./newbranch/.morph-system-branch -d ./newbranch/test -d ./newbranch/test/morphs -d ./newbranch/test/morphs/.git -f ./newbranch/.morph-system-branch/config -f ./newbranch/test/morphs/hello-stratum.morph -f ./newbranch/test/morphs/hello-system.morph -Current branches: - master -* newbranch -Current origin: -* remote origin - Fetch URL: file://TMP/morphs - Push URL: file://TMP/morphs - HEAD branch: master - Remote branches: - alfred tracked - master tracked - Local branch configured for 'git pull': - master merges with remote master - Local ref configured for 'git push': - master pushes to master (up to date) diff --git a/tests.branching/checkout-existing-branch.script b/tests.branching/checkout-existing-branch.script deleted file mode 100755 index 8ab2834d..00000000 --- a/tests.branching/checkout-existing-branch.script +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2012,2014-2015 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, see <http://www.gnu.org/licenses/>. - - -## Verify that "morph checkout test:morphs master" works. - -set -eu - -cd "$DATADIR/workspace" -"$SRCDIR/scripts/test-morph" init -"$SRCDIR/scripts/test-morph" checkout test:morphs master - -echo "File tree:" -"$SRCDIR/scripts/list-tree" . | grep -v '/\.git/' | - sed 's,/cache/gits/file_[^/]*_,/cache/gits/file_,' | - grep -v 'cache/gits/file_[^/]*/' - -echo "Current branches:" -"$SRCDIR/scripts/run-git-in" master/test/morphs branch diff --git a/tests.branching/checkout-existing-branch.stdout b/tests.branching/checkout-existing-branch.stdout deleted file mode 100644 index a6026269..00000000 --- a/tests.branching/checkout-existing-branch.stdout +++ /dev/null @@ -1,13 +0,0 @@ -File tree: -d . -d ./.morph -d ./master -d ./master/.morph-system-branch -d ./master/test -d ./master/test/morphs -d ./master/test/morphs/.git -f ./master/.morph-system-branch/config -f ./master/test/morphs/hello-stratum.morph -f ./master/test/morphs/hello-system.morph -Current branches: -* master diff --git a/tests.branching/edit-handles-submodules.script b/tests.branching/edit-handles-submodules.script deleted file mode 100755 index b7a57b42..00000000 --- a/tests.branching/edit-handles-submodules.script +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2012-2015 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, see <http://www.gnu.org/licenses/>. - - -## 'morph edit' should set up git URL rewriting correctly so that submodule -## commands function as usual, despite our prefixing and mirroring. - -set -eu - -cd "$DATADIR/workspace" -"$SRCDIR/scripts/test-morph" init -"$SRCDIR/scripts/test-morph" branch test:morphs newbranch - -# Submodules should be set up automatically -"$SRCDIR/scripts/test-morph" edit hello - -cd "$DATADIR/workspace/newbranch/test/hello" -[ -e foolib/README ] - diff --git a/tests.branching/edit-handles-submodules.setup b/tests.branching/edit-handles-submodules.setup deleted file mode 100755 index 922afbe3..00000000 --- a/tests.branching/edit-handles-submodules.setup +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -# Copyright (C) 2012,2015 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, see <http://www.gnu.org/licenses/>. - -set -eu - -# Create a dummy submodule -mkdir "$DATADIR/foolib" -cd "$DATADIR/foolib" - -echo "Thanks" > README -git init . -git add README -git commit -m "Initial commit" - -# Use this in hello chunk -cd "$DATADIR/hello" -git submodule add "$DATADIR/foolib" foolib/ -git commit -m "Use Foolib submodule" - -# Rewrite the URL, as we would do in Trove -cat <<EOF > "$DATADIR/hello/.gitmodules" -[submodule "foolib"] - path = foolib - url = test:foolib -EOF -git add .gitmodules -git commit -m "Use Foolib from test: prefix" diff --git a/tests.branching/edit-updates-stratum.script b/tests.branching/edit-updates-stratum.script deleted file mode 100755 index 6d330016..00000000 --- a/tests.branching/edit-updates-stratum.script +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2012-2015 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, see <http://www.gnu.org/licenses/>. - - -## Verify that "morph edit" clones a chunk repository into a system branch. - -set -eu - -# Create system branch. -cd "$DATADIR/workspace" -"$SRCDIR/scripts/test-morph" init -"$SRCDIR/scripts/test-morph" branch test:morphs newbranch - -# Edit chunk. -"$SRCDIR/scripts/test-morph" edit hello - -# See what effect the editing had. -"$SRCDIR/scripts/run-git-in" "newbranch/test/morphs" diff diff --git a/tests.branching/edit-updates-stratum.stdout b/tests.branching/edit-updates-stratum.stdout deleted file mode 100644 index 2372745e..00000000 --- a/tests.branching/edit-updates-stratum.stdout +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/hello-stratum.morph b/hello-stratum.morph -index 159854f..0036ee3 100644 ---- a/hello-stratum.morph -+++ b/hello-stratum.morph -@@ -3,7 +3,8 @@ kind: stratum - chunks: - - name: hello - repo: test:hello -- ref: master -+ ref: newbranch -+ unpetrify-ref: master - build-depends: [] - build-mode: bootstrap - build-system: manual diff --git a/tests.branching/edit-works-after-branch-root-was-renamed.script b/tests.branching/edit-works-after-branch-root-was-renamed.script deleted file mode 100755 index e2c253f8..00000000 --- a/tests.branching/edit-works-after-branch-root-was-renamed.script +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2012-2015 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, see <http://www.gnu.org/licenses/>. - - -## Verify that the branch root repository created by "morph branch" or -## "morph checkout" can be renamed and "morph edit" still finds the -## branch root repo and works. - -set -eu - -# FIXME: This test is disabled, because a) it's a corner case and b) Lars -# ran out of time to implement support for it. -cat "$SRCDIR/tests.branching/edit-works-after-branch-root-was-renamed.stdout" -exit 0 - -cd "$DATADIR/workspace" - -"$SRCDIR/scripts/test-morph" init -"$SRCDIR/scripts/test-morph" checkout test:morphs master - -cd "$DATADIR/workspace/master" -mv test:morphs my-renamed-morphs - -"$SRCDIR/scripts/test-morph" edit hello - -"$SRCDIR/scripts/list-tree" "$DATADIR/workspace" | grep -v '/\.git/' | - sed 's,/cache/gits/file_[^/]*_,/cache/gits/file_,' | - grep -v 'cache/gits/file_[^/]*/' diff --git a/tests.branching/edit-works-after-branch-root-was-renamed.stdout b/tests.branching/edit-works-after-branch-root-was-renamed.stdout deleted file mode 100644 index f15fe30a..00000000 --- a/tests.branching/edit-works-after-branch-root-was-renamed.stdout +++ /dev/null @@ -1,12 +0,0 @@ -d . -d ./.morph -d ./master -d ./master/.morph-system-branch -d ./master/my-renamed-morphs -d ./master/my-renamed-morphs/.git -d ./master/test:hello -d ./master/test:hello/.git -f ./master/.morph-system-branch/config -f ./master/my-renamed-morphs/hello-stratum.morph -f ./master/my-renamed-morphs/hello-system.morph -f ./master/test:hello/hello.morph diff --git a/tests.branching/morph-repository-stored-in-cloned-repositories.script b/tests.branching/morph-repository-stored-in-cloned-repositories.script deleted file mode 100755 index baa0868b..00000000 --- a/tests.branching/morph-repository-stored-in-cloned-repositories.script +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2012,2014-2015 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, see <http://www.gnu.org/licenses/>. - - -## Verify that morph branch/checkout/edit create repositories that have -## a "git config morph.repository" option set so that we can -## identify these repositories later even when the user has renamed or -## moved their local directories. - -set -eu - -cd "$DATADIR/workspace" - -"$SRCDIR/scripts/test-morph" init -"$SRCDIR/scripts/test-morph" branch test:morphs newbranch - -echo "morph.repository in branch root repository:" -cd "$DATADIR/workspace/newbranch/test/morphs" -git config morph.repository -echo - -cd "$DATADIR/workspace" -"$SRCDIR/scripts/test-morph" checkout test:morphs master - -echo "morph.repository in branch root repository of a checkout:" -cd "$DATADIR/workspace/master/test/morphs" -git config morph.repository -echo - -cd "$DATADIR/workspace/master" -"$SRCDIR/scripts/test-morph" edit hello - -echo "morph.repository of an edited repository:" -cd "$DATADIR/workspace/master/test/hello" -git config morph.repository diff --git a/tests.branching/morph-repository-stored-in-cloned-repositories.stdout b/tests.branching/morph-repository-stored-in-cloned-repositories.stdout deleted file mode 100644 index eadcdd19..00000000 --- a/tests.branching/morph-repository-stored-in-cloned-repositories.stdout +++ /dev/null @@ -1,8 +0,0 @@ -morph.repository in branch root repository: -test:morphs - -morph.repository in branch root repository of a checkout: -test:morphs - -morph.repository of an edited repository: -test:hello |