test-check-code-hg: skip test if not in a working dir (issue3248). stable
authorGreg Ward <greg@gerg.ca>
Sat, 18 Feb 2012 16:30:17 -0500
branchstable
changeset 16179 be6ac2ecc7f8
parent 16175 280e834c9d15
child 16187 82ce91a9fd94
test-check-code-hg: skip test if not in a working dir (issue3248).
tests/test-check-code-hg.t
--- a/tests/test-check-code-hg.t	Sat Feb 25 19:39:55 2012 +0100
+++ b/tests/test-check-code-hg.t	Sat Feb 18 16:30:17 2012 -0500
@@ -1,6 +1,9 @@
   $ check_code="$TESTDIR"/../contrib/check-code.py
   $ cd "$TESTDIR"/..
-
+  $ if ! hg identify -q > /dev/null; then
+  >     echo "skipped: not a Mercurial working dir" >&2
+  >     exit 80
+  > fi
   $ hg manifest | xargs "$check_code" || echo 'FAILURE IS NOT AN OPTION!!!'
 
   $ hg manifest | xargs "$check_code" --warnings --nolineno --per-file=0 || true