summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2011-12-01 11:38:28 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2011-12-01 11:38:28 +0000
commit618a2595b6a657ab9d7d48ea3634d8533c563dcf (patch)
treefde690b2c1a4f272eb5f1d6f45646d46e6e431e4 /tests
parent209e86022f4ced8bfe05cd87af0cd7649e547ca2 (diff)
downloadmorph-618a2595b6a657ab9d7d48ea3634d8533c563dcf.tar.gz
add simple system image build test
Diffstat (limited to 'tests')
-rwxr-xr-xtests/build-system.script29
-rwxr-xr-xtests/setup_once13
2 files changed, 42 insertions, 0 deletions
diff --git a/tests/build-system.script b/tests/build-system.script
new file mode 100755
index 00000000..f206a277
--- /dev/null
+++ b/tests/build-system.script
@@ -0,0 +1,29 @@
+#!/bin/sh
+#
+# Test build a simple system image.
+#
+# Copyright (C) 2011 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 -ex
+
+cache="$DATADIR/build-system-cache"
+mkdir "$cache"
+./morph --no-default-configs build repo farrokh hello-system.morph \
+ --git-base-url "file://$DATADIR/" \
+ --cachedir="$cache" --keep-path --verbose
+find "$cache" -name '*.system.*' -type f | wc -l
+rm -rf "$cache"
+
diff --git a/tests/setup_once b/tests/setup_once
index 41ef09f3..e969c1a3 100755
--- a/tests/setup_once
+++ b/tests/setup_once
@@ -56,6 +56,7 @@ cat <<EOF > hello.morph
"gcc -o hello hello.c"
],
"install-commands": [
+ "install -d \\"\$DESTDIR\\"/etc",
"install -d \\"\$DESTDIR\\"/bin",
"install hello \\"\$DESTDIR\\"/bin/hello"
]
@@ -78,6 +79,18 @@ cat <<EOF > hello-stratum.morph
EOF
git add hello-stratum.morph
+cat <<EOF > hello-system.morph
+{
+ "name": "hello-system",
+ "kind": "system",
+ "disk-size": "1G",
+ "strata": [
+ "hello-stratum"
+ ]
+}
+EOF
+git add hello-system.morph
+
git commit --quiet -m "add a hello world program and morphs"
git checkout --quiet master