From a965863b37774420c48b66db159c715567d461b2 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Fri, 6 Jul 2012 12:47:58 +0000 Subject: tests: add test for chunk failure dumping logs --- tests/build-chunk-failures-dump-log.exit | 1 + tests/build-chunk-failures-dump-log.script | 40 ++++++++++++++++++++++++++++++ tests/build-chunk-failures-dump-log.stdout | 8 ++++++ 3 files changed, 49 insertions(+) create mode 100644 tests/build-chunk-failures-dump-log.exit create mode 100755 tests/build-chunk-failures-dump-log.script create mode 100644 tests/build-chunk-failures-dump-log.stdout (limited to 'tests') 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 <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 -- cgit v1.2.1