summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-04-25 15:58:51 +0100
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-04-25 15:58:51 +0100
commitff7327e84f75e14363ba2790b54ceed257a5f25e (patch)
tree776300f28e98720c7120d51e85c77e0ecd5174f3 /tests
parent8b9c9a046cc9c8120b3faa8a77eb15ff2ed79f65 (diff)
parentc42e0573b88ecf439b4e2013ceddbaddf87eb1df (diff)
downloadmorph-ff7327e84f75e14363ba2790b54ceed257a5f25e.tar.gz
Merge branch 'master' of gitorious.org:baserock/morph
Diffstat (limited to 'tests')
-rwxr-xr-xtests/update-gits-submodules.script39
-rw-r--r--tests/update-gits-submodules.stdout3
2 files changed, 42 insertions, 0 deletions
diff --git a/tests/update-gits-submodules.script b/tests/update-gits-submodules.script
new file mode 100755
index 00000000..1cdd917e
--- /dev/null
+++ b/tests/update-gits-submodules.script
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# Test that 'morph update-gits' caches all the submodules needed by
+# a 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
+
+# create a repo to use as a submodule
+submodule="$DATADIR/submodule-repo"
+"$SRCDIR/scripts/cmd-filter" git init --quiet "$submodule"
+"$SRCDIR/scripts/run-git-in" "$submodule" commit --quiet --allow-empty \
+ --allow-empty-message -m ""
+
+# create an empty commit in a chunk repository
+chunkrepo="$DATADIR/chunk-repo"
+"$SRCDIR/scripts/run-git-in" "$chunkrepo" checkout --quiet farrokh
+"$SRCDIR/scripts/run-git-in" "$chunkrepo" submodule --quiet add "$submodule"
+"$SRCDIR/scripts/run-git-in" "$chunkrepo" commit --quiet -m "add submodule"
+
+"$SRCDIR/scripts/test-morph" update-gits morphs-repo master hello-stratum.morph
+
+test -d "$DATADIR/cache/gits/"*chunk?repo* && echo chunk-repo cached
+test -d "$DATADIR/cache/gits/"*morphs?repo* && echo morphs-repo cached
+test -d "$DATADIR/cache/gits/"*submodule?repo* && echo submodule-repo cached
diff --git a/tests/update-gits-submodules.stdout b/tests/update-gits-submodules.stdout
new file mode 100644
index 00000000..5b20a81e
--- /dev/null
+++ b/tests/update-gits-submodules.stdout
@@ -0,0 +1,3 @@
+chunk-repo cached
+morphs-repo cached
+submodule-repo cached