summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-04-23 15:51:08 +0100
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-04-23 15:51:08 +0100
commit391af21d8fe5592b334b7417d76415a6fbe64dda (patch)
tree68888159788b8ab1d5055cb6f45ee604d3870600 /tests
parentc05a40ae1dbfc558e90e418242f684e291faf4a1 (diff)
parentb87bd4aba33be03a5b973f5940b1b5f36617f7d1 (diff)
downloadmorph-391af21d8fe5592b334b7417d76415a6fbe64dda.tar.gz
Merge branch 'master' of gitorious.org:baserock/morph
Diffstat (limited to 'tests')
-rwxr-xr-xtests/build-system-autotools.script57
-rw-r--r--tests/build-system-autotools.stdout8
-rwxr-xr-xtests/build-system-python-distutils.script61
-rw-r--r--tests/build-system-python-distutils.stdout11
4 files changed, 137 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/
+
diff --git a/tests/build-system-python-distutils.script b/tests/build-system-python-distutils.script
new file mode 100755
index 00000000..2c7c7df6
--- /dev/null
+++ b/tests/build-system-python-distutils.script
@@ -0,0 +1,61 @@
+#!/bin/sh
+#
+# Convert the hello-chunk project to python with distutils
+#
+# 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
+
+git rm --quiet hello.c
+cat <<EOF >hello
+#!/usr/bin/python
+print "hello, world"
+EOF
+git add hello
+
+cat <<EOF >setup.py
+#!/usr/bin/python
+from distutils.core import setup
+setup(name='hello',
+ scripts=['hello'])
+EOF
+git add setup.py
+
+cat <<EOF >hello.morph
+{
+ "name": "hello",
+ "kind": "chunk",
+ "build-system": "python-distutils"
+}
+EOF
+git add hello.morph
+
+git commit --quiet -m 'convert hello into a python project'
+
+"$SRCDIR/scripts/test-morph" build --prefix= 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-python-distutils.stdout b/tests/build-system-python-distutils.stdout
new file mode 100644
index 00000000..b78b608f
--- /dev/null
+++ b/tests/build-system-python-distutils.stdout
@@ -0,0 +1,11 @@
+.chunk.hello:
+./
+baserock/
+baserock/hello.meta
+bin/
+bin/hello
+lib/
+lib/python2.7/
+lib/python2.7/site-packages/
+lib/python2.7/site-packages/hello-0.0.0-py2.7.egg-info
+