summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2011-12-01 12:27:23 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2011-12-01 12:27:23 +0000
commit6136d3edd1129f5f6b517d83eb74866459b9c22f (patch)
treeacd8a98385364670c911c23432315deae7b8c4aa /tests
parent871308c2c4c97c2c7bf4318f832a90924d793b03 (diff)
downloadmorph-6136d3edd1129f5f6b517d83eb74866459b9c22f.tar.gz
add test case for referring to a missing branch in the repo
Have to make sure it is caught properly.
Diffstat (limited to 'tests')
-rw-r--r--tests/missing-ref.exit1
-rwxr-xr-xtests/missing-ref.script28
-rw-r--r--tests/missing-ref.stderr4
3 files changed, 33 insertions, 0 deletions
diff --git a/tests/missing-ref.exit b/tests/missing-ref.exit
new file mode 100644
index 00000000..d00491fd
--- /dev/null
+++ b/tests/missing-ref.exit
@@ -0,0 +1 @@
+1
diff --git a/tests/missing-ref.script b/tests/missing-ref.script
new file mode 100755
index 00000000..e11653ea
--- /dev/null
+++ b/tests/missing-ref.script
@@ -0,0 +1,28 @@
+#!/bin/sh
+#
+# Test building with a bad reference.
+#
+# 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 -e
+
+cache="$DATADIR/build-chunk-cache"
+mkdir "$cache"
+./morph --no-default-configs build repo non-existent-branch hello.morph \
+ --git-base-url "file://$DATADIR/" \
+ --cachedir="$cache" --keep-path
+rm -rf "$cache"
+
diff --git a/tests/missing-ref.stderr b/tests/missing-ref.stderr
new file mode 100644
index 00000000..5cf767b3
--- /dev/null
+++ b/tests/missing-ref.stderr
@@ -0,0 +1,4 @@
+ERROR: Command failed: git cat-file blob non-existent-branch:hello.morph
+Output from command:
+fatal: Not a valid object name non-existent-branch:hello.morph
+