summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-04-19 15:25:47 +0100
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-04-19 15:25:47 +0100
commitac0a1bb2491147951e000ce8d4d439b8a2fac7dd (patch)
tree30f2186f1fcb4f024d1dc4e7c7b218cba07bcef0 /tests
parentbaee268b9f0d6a3dfc04661023bc78dfda3f2f0e (diff)
downloadmorph-ac0a1bb2491147951e000ce8d4d439b8a2fac7dd.tar.gz
Add test case for morphless chunks
Diffstat (limited to 'tests')
-rwxr-xr-xtests/morphless-chunks.script61
1 files changed, 61 insertions, 0 deletions
diff --git a/tests/morphless-chunks.script b/tests/morphless-chunks.script
new file mode 100755
index 00000000..0d4c725e
--- /dev/null
+++ b/tests/morphless-chunks.script
@@ -0,0 +1,61 @@
+#!/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
+
+
+# Create an auto-detectable chunk.
+
+mkdir "$DATADIR/morphless"
+cd "$DATADIR/morphless"
+
+touch configure
+chmod +x 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",
+ "sources": [
+ {
+ "name": "morphless",
+ "ref": "master"
+ }
+ ]
+}
+EOF
+git init --quiet
+git add alfred.morph
+git commit --quiet -m initial
+
+"$SRCDIR/scripts/test-morph" build stratum master alfred.morph
+
+ls -l "$DATADIR/cache/gits/"*.chunk.*