# HG changeset patch # User Mads Kiilerich # Date 2008-11-26 23:57:31 # Node ID dbc40381620e584e914694ba4dd08c63555fa414 # Parent fdcde929ce4f23dafa326c7989ac109a14add515 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" diff --git a/tests/hghave b/tests/hghave --- a/tests/hghave +++ b/tests/hghave @@ -154,6 +154,9 @@ def has_pygments(): 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 @@ checks = { "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"), diff --git a/tests/test-convert-svn-sink b/tests/test-convert-svn-sink --- a/tests/test-convert-svn-sink +++ b/tests/test-convert-svn-sink @@ -1,6 +1,6 @@ #!/bin/sh -"$TESTDIR/hghave" svn svn-bindings || exit 80 +"$TESTDIR/hghave" svn svn-bindings no-outer-repo || exit 80 fixpath() { diff --git a/tests/test-dispatch b/tests/test-dispatch --- a/tests/test-dispatch +++ b/tests/test-dispatch @@ -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 diff --git a/tests/test-extension b/tests/test-extension --- a/tests/test-extension +++ b/tests/test-extension @@ -1,6 +1,8 @@ #!/bin/sh # Test basic extension support +"$TESTDIR/hghave" no-outer-repo || exit 80 + cat > foobar.py < a diff --git a/tests/test-glog b/tests/test-glog --- a/tests/test-glog +++ b/tests/test-glog @@ -70,6 +70,8 @@ # |/ # o (0) root +"$TESTDIR/hghave" no-outer-repo || exit 80 + set -e commit()