summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2012-07-06 12:47:58 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2012-07-06 12:47:58 +0000
commita965863b37774420c48b66db159c715567d461b2 (patch)
tree28e0d0af022d6cdd98a4ce05454a3ab06fcc899f /tests
parenteb7609d885733e857480a311fa9bce2ebaa7d92f (diff)
downloadmorph-a965863b37774420c48b66db159c715567d461b2.tar.gz
tests: add test for chunk failure dumping logs
Diffstat (limited to 'tests')
-rw-r--r--tests/build-chunk-failures-dump-log.exit1
-rwxr-xr-xtests/build-chunk-failures-dump-log.script40
-rw-r--r--tests/build-chunk-failures-dump-log.stdout8
3 files changed, 49 insertions, 0 deletions
diff --git a/tests/build-chunk-failures-dump-log.exit b/tests/build-chunk-failures-dump-log.exit
new file mode 100644
index 00000000..d00491fd
--- /dev/null
+++ b/tests/build-chunk-failures-dump-log.exit
@@ -0,0 +1 @@
+1
diff --git a/tests/build-chunk-failures-dump-log.script b/tests/build-chunk-failures-dump-log.script
new file mode 100755
index 00000000..e1015744
--- /dev/null
+++ b/tests/build-chunk-failures-dump-log.script
@@ -0,0 +1,40 @@
+#!/bin/bash
+#
+# Test building a chunk.
+#
+# 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 master
+cat <<EOF >false.morph
+{
+ "name": "false",
+ "kind": "chunk",
+ "build-system": "dummy",
+ "build-commands": [
+ "echo The next command will fail",
+ "false"
+ ]
+}
+EOF
+git add false.morph
+git commit --quiet -m "Make a morphology that fails."
+
+"$SRCDIR/scripts/test-morph" build test:chunk-repo master false.morph \
+ 2>/dev/null
diff --git a/tests/build-chunk-failures-dump-log.stdout b/tests/build-chunk-failures-dump-log.stdout
new file mode 100644
index 00000000..7a13c12a
--- /dev/null
+++ b/tests/build-chunk-failures-dump-log.stdout
@@ -0,0 +1,8 @@
+build failed
+# configure
+# # echo dummy configure
+dummy configure
+# build
+# # echo The next command will fail
+The next command will fail
+# # false