summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2012-04-23 10:52:37 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2012-04-23 10:52:37 +0000
commit376d81e333a47b4c666071a946c12de5bde1de37 (patch)
tree76f1c71874e2e06aa44fd32745fccd1eba3d165a /tests
parent44764506c64ec132e593e5a0b060361c21107cb2 (diff)
downloadmorph-376d81e333a47b4c666071a946c12de5bde1de37.tar.gz
tests: add test for build-system: autotools
Diffstat (limited to 'tests')
-rwxr-xr-xtests/build-system-autotools.script57
-rw-r--r--tests/build-system-autotools.stdout8
2 files changed, 65 insertions, 0 deletions
diff --git a/tests/build-system-autotools.script b/tests/build-system-autotools.script
new file mode 100755
index 00000000..edee7adb
--- /dev/null
+++ b/tests/build-system-autotools.script
@@ -0,0 +1,57 @@
+#!/bin/sh
+#
+# Convert the hello-chunk project to something autotools-like, then
+# build it.
+#
+# Copyright (C) 2011, 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
+
+chunkrepo="$DATADIR/chunk-repo"
+cd "$chunkrepo"
+
+git checkout --quiet farrokh
+
+cat <<'EOF' >Makefile
+all: hello
+
+install: all
+ install -d "$(DESTDIR)/etc"
+ install -d "$(DESTDIR)/bin"
+ install hello "$(DESTDIR)/bin/hello"
+EOF
+git add Makefile
+
+cat <<EOF > hello.morph
+{
+ "name": "hello",
+ "kind": "chunk",
+ "build-system": "autotools",
+ "configure-commands": []
+}
+EOF
+git add hello.morph
+git commit --quiet -m "Convert hello to an autotools project"
+
+"$SRCDIR/scripts/test-morph" build chunk-repo farrokh hello.morph
+
+for chunk in "$DATADIR/cache/"*.chunk.*
+do
+ echo "$chunk:" | sed 's/[^.]*//'
+ tar -tf "$chunk" | LC_ALL=C sort | sed '/^\.\/./s:^\./::'
+ echo
+done
diff --git a/tests/build-system-autotools.stdout b/tests/build-system-autotools.stdout
new file mode 100644
index 00000000..8077cac2
--- /dev/null
+++ b/tests/build-system-autotools.stdout
@@ -0,0 +1,8 @@
+.chunk.hello:
+./
+baserock/
+baserock/hello.meta
+bin/
+bin/hello
+etc/
+