tests: Skip tests if they will fail because of outer repo
For different reasons these tests will fail if run in a tmpdir which is in a hg
repo.
The following three tests assumes no .hg in path dirs - I don't know how to
work around that:
* test-dispatch explicitly tests for no repo and expects "abort: There is no
Mercurial repository here (.hg not found)!"
* test-extension expects parentui to be None when not cd'ed to a repo dir
* test-globalopts tests that implicit -R works correctly - that could perhaps be
done from another repo instead of assuming no repo
The following two might be worth investigating further:
* test-convert-svn-sink fails for unknown reasons, starting with "abort:
unresolved merge conflicts (see hg resolve)"
* test-glog gets strange failures when testing "from outer space"
--- a/tests/hghave Thu Nov 27 00:57:30 2008 +0100
+++ b/tests/hghave Thu Nov 27 00:57:31 2008 +0100
@@ -154,6 +154,9 @@
except ImportError:
return False
+def has_outer_repo():
+ return matchoutput('hg root 2>&1', r'')
+
checks = {
"baz": (has_baz, "GNU Arch baz client"),
"bzr": (has_bzr, "Canonical's Bazaar client"),
@@ -169,6 +172,7 @@
"inotify": (has_inotify, "inotify extension support"),
"lsprof": (has_lsprof, "python lsprof module"),
"mtn": (has_mtn, "monotone client (> 0.31)"),
+ "outer-repo": (has_outer_repo, "outer repo"),
"pygments": (has_pygments, "Pygments source highlighting library"),
"svn": (has_svn, "subversion client and admin tools"),
"svn-bindings": (has_svn_bindings, "subversion python bindings"),
--- a/tests/test-convert-svn-sink Thu Nov 27 00:57:30 2008 +0100
+++ b/tests/test-convert-svn-sink Thu Nov 27 00:57:31 2008 +0100
@@ -1,6 +1,6 @@
#!/bin/sh
-"$TESTDIR/hghave" svn svn-bindings || exit 80
+"$TESTDIR/hghave" svn svn-bindings no-outer-repo || exit 80
fixpath()
{
--- a/tests/test-dispatch Thu Nov 27 00:57:30 2008 +0100
+++ b/tests/test-dispatch Thu Nov 27 00:57:31 2008 +0100
@@ -1,6 +1,8 @@
#!/bin/sh
# test command parsing and dispatch
+"$TESTDIR/hghave" no-outer-repo || exit 80
+
hg init a
cd a
echo a > a
--- a/tests/test-extension Thu Nov 27 00:57:30 2008 +0100
+++ b/tests/test-extension Thu Nov 27 00:57:31 2008 +0100
@@ -1,6 +1,8 @@
#!/bin/sh
# Test basic extension support
+"$TESTDIR/hghave" no-outer-repo || exit 80
+
cat > foobar.py <<EOF
import os
from mercurial import commands
--- a/tests/test-globalopts Thu Nov 27 00:57:30 2008 +0100
+++ b/tests/test-globalopts Thu Nov 27 00:57:31 2008 +0100
@@ -1,5 +1,7 @@
#!/bin/sh
+"$TESTDIR/hghave" no-outer-repo || exit 80
+
hg init a
cd a
echo a > a
--- a/tests/test-glog Thu Nov 27 00:57:30 2008 +0100
+++ b/tests/test-glog Thu Nov 27 00:57:31 2008 +0100
@@ -70,6 +70,8 @@
# |/
# o (0) root
+"$TESTDIR/hghave" no-outer-repo || exit 80
+
set -e
commit()