aboutsummaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorBernard Ogden <bernie.ogden@linaro.org>2015-04-20 14:37:46 +0100
committerBernard Ogden <bernie.ogden@linaro.org>2015-04-20 14:37:46 +0100
commit7c5e743e2bdedaf5cc2b3213eebc37a4dec177a7 (patch)
tree03f8211e2609715c7d7ac3a8dd18d49d3e657f8a /testsuite
parent057a64d54acd14dfe07d8eb7725985df110237e2 (diff)
Propagate git-parsing errors from checkout.sh
Lets us fail fast, in a place that indicates what the problem is. Most of these failure cases can't occur in the present state of the code, so most of them don't have tests. It's still worth propagating the errors, in case the code changes. Change-Id: I270182cd5938e56dde62c934a76c41c00805d68f
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/test.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/testsuite/test.sh b/testsuite/test.sh
index 42f5269d..adb6dba7 100755
--- a/testsuite/test.sh
+++ b/testsuite/test.sh
@@ -1386,6 +1386,24 @@ for service in "foomatic://" "http:" "http:/fake.git" "http/" "http//" ""; do
fi
done
+#confirm that checkout fails with bad repo - abe is so forgiving that I can only find one suitable input
+in="http://"
+testing="checkout: ${in} should fail with 'cannot parse repo' message."
+if test x"${debug}" = xyes; then
+ out="`cd ${local_snapshots} && checkout ${in} 2> >(tee /dev/stderr)`"
+else
+ out="`cd ${local_snapshots} && checkout ${in} 2>&1`"
+fi
+if test $? -eq 0; then
+ fail "${testing}"
+else
+ if echo "${out}" | tail -n1 | grep -q "^ERROR.*: git_parser (Malformed input\\. No repo found\\.)$"; then
+ pass "${testing}"
+ else
+ fail "${testing}"
+ fi
+fi
+
test_checkout ()
{
local should="$1"