# HG changeset patch # User Mads Kiilerich # Date 1320632693 -3600 # Node ID c5c9ca3719f903c2e909311c0043fd3803947f77 # Parent 7cbb81c470255a3faf5fa2c01843948e6d5a756a tests: use 'hghave serve' to guard tests that requires serve daemon management diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/hghave --- a/tests/hghave Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/hghave Mon Nov 07 03:24:53 2011 +0100 @@ -215,6 +215,9 @@ def has_system_sh(): return os.name != 'nt' +def has_serve(): + return os.name != 'nt' # gross approximation + checks = { "baz": (has_baz, "GNU Arch baz client"), "bzr": (has_bzr, "Canonical's Bazaar client"), @@ -237,6 +240,7 @@ "p4": (has_p4, "Perforce server and client"), "pyflakes": (has_pyflakes, "Pyflakes python linter"), "pygments": (has_pygments, "Pygments source highlighting library"), + "serve": (has_serve, "platform and python can manage 'hg serve -d'"), "ssl": (has_ssl, "python >= 2.6 ssl module and python OpenSSL"), "svn": (has_svn, "subversion client and admin tools"), "svn13": (has_svn13, "subversion client and admin tools >= 1.3"), diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-archive.t --- a/tests/test-archive.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-archive.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,3 +1,5 @@ + $ "$TESTDIR/hghave" serve || exit 80 + $ hg init test $ cd test $ echo foo>foo diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-bad-pull.t --- a/tests/test-bad-pull.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-bad-pull.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,3 +1,5 @@ + $ "$TESTDIR/hghave" serve || exit 80 + $ hg clone http://localhost:$HGPORT/ copy abort: error: Connection refused [255] diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-bookmarks-pushpull.t --- a/tests/test-bookmarks-pushpull.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-bookmarks-pushpull.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,3 +1,5 @@ + $ "$TESTDIR/hghave" serve || exit 80 + initialize $ hg init a diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-fetch.t --- a/tests/test-fetch.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-fetch.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,3 +1,5 @@ + $ "$TESTDIR/hghave" serve || exit 80 + $ echo "[extensions]" >> $HGRCPATH $ echo "fetch=" >> $HGRCPATH diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-getbundle.t --- a/tests/test-getbundle.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-getbundle.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,3 +1,4 @@ + $ "$TESTDIR/hghave" serve || exit 80 = Test the getbundle() protocol function = diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-hgweb-commands.t --- a/tests/test-hgweb-commands.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-hgweb-commands.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,3 +1,5 @@ + $ "$TESTDIR/hghave" serve || exit 80 + An attempt at more fully testing the hgweb web interface. The following things are tested elsewhere and are therefore omitted: - archive, tested in test-archive diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-hgweb-descend-empties.t --- a/tests/test-hgweb-descend-empties.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-hgweb-descend-empties.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,3 +1,5 @@ + $ "$TESTDIR/hghave" serve || exit 80 + Test chains of near empty directories, terminating 3 different ways: - a1: file at level 4 (deepest) - b1: two dirs at level 3 diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-hgweb-diffs.t --- a/tests/test-hgweb-diffs.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-hgweb-diffs.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,4 +1,4 @@ - $ "$TESTDIR/hghave" execbit || exit 80 + $ "$TESTDIR/hghave" serve execbit || exit 80 setting up repo diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-hgweb-empty.t --- a/tests/test-hgweb-empty.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-hgweb-empty.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,3 +1,5 @@ + $ "$TESTDIR/hghave" serve || exit 80 + Some tests for hgweb in an empty repository $ hg init test diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-hgweb-filelog.t --- a/tests/test-hgweb-filelog.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-hgweb-filelog.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,3 +1,4 @@ + $ "$TESTDIR/hghave" serve || exit 80 $ hg init test $ cd test diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-hgweb-raw.t --- a/tests/test-hgweb-raw.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-hgweb-raw.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,3 +1,5 @@ + $ "$TESTDIR/hghave" serve || exit 80 + Test raw style of hgweb $ hg init test diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-hgweb-removed.t --- a/tests/test-hgweb-removed.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-hgweb-removed.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,3 +1,5 @@ + $ "$TESTDIR/hghave" serve || exit 80 + setting up repo $ hg init test diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-hgweb.t --- a/tests/test-hgweb.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-hgweb.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,3 +1,5 @@ + $ "$TESTDIR/hghave" serve || exit 80 + Some tests for hgweb. Tests static files, plain files and different 404's. $ hg init test diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-hgwebdir.t --- a/tests/test-hgwebdir.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-hgwebdir.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,3 +1,5 @@ + $ "$TESTDIR/hghave" serve || exit 80 + Tests some basic hgwebdir functionality. Tests setting up paths and collection, different forms of 404s and the subdirectory support. diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-hgwebdirsym.t --- a/tests/test-hgwebdirsym.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-hgwebdirsym.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,6 +1,6 @@ Tests whether or not hgwebdir properly handles various symlink topologies. - $ "$TESTDIR/hghave" symlink || exit 80 + $ "$TESTDIR/hghave" serve symlink || exit 80 $ hg init a $ echo a > a/a $ hg --cwd a ci -Ama -d'1 0' diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-highlight.t --- a/tests/test-highlight.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-highlight.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,5 +1,5 @@ - $ "$TESTDIR/hghave" pygments || exit 80 + $ "$TESTDIR/hghave" pygments serve || exit 80 $ cat <> $HGRCPATH > [extensions] > highlight = diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-http-branchmap.t --- a/tests/test-http-branchmap.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-http-branchmap.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,3 +1,4 @@ + $ "$TESTDIR/hghave" serve || exit 80 $ hgserve() { > hg serve -a localhost -p $HGPORT1 -d --pid-file=hg.pid -E errors.log -v $@ diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-http-clone-r.t --- a/tests/test-http-clone-r.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-http-clone-r.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,3 +1,5 @@ + $ "$TESTDIR/hghave" serve || exit 80 + creating 'remote $ hg init remote diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-http-proxy.t --- a/tests/test-http-proxy.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-http-proxy.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,3 +1,4 @@ + $ "$TESTDIR/hghave" serve || exit 80 $ hg init a $ cd a diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-http.t --- a/tests/test-http.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-http.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,3 +1,4 @@ + $ "$TESTDIR/hghave" serve || exit 80 $ hg init test $ cd test diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-https.t --- a/tests/test-https.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-https.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,6 +1,6 @@ Proper https client requires the built-in ssl from Python 2.6. - $ "$TESTDIR/hghave" ssl || exit 80 + $ "$TESTDIR/hghave" serve ssl || exit 80 Certificates created with: printf '.\n.\n.\n.\n.\nlocalhost\nhg@localhost\n' | \ diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-hup.t --- a/tests/test-hup.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-hup.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,6 +1,6 @@ Test hangup signal in the middle of transaction - $ "$TESTDIR/hghave" fifo || exit 80 + $ "$TESTDIR/hghave" serve fifo || exit 80 $ hg init $ mkfifo p $ hg serve --stdio < p & diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-identify.t --- a/tests/test-identify.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-identify.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,4 +1,4 @@ - $ "$TESTDIR/hghave" no-outer-repo || exit 80 + $ "$TESTDIR/hghave" no-outer-repo serve || exit 80 no repo diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-incoming-outgoing.t --- a/tests/test-incoming-outgoing.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-incoming-outgoing.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,3 +1,5 @@ + $ "$TESTDIR/hghave" serve || exit 80 + $ hg init test $ cd test $ for i in 0 1 2 3 4 5 6 7 8; do diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-interhg.t --- a/tests/test-interhg.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-interhg.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,3 +1,5 @@ + $ "$TESTDIR/hghave" serve || exit 80 + $ hg init test $ cd test diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-keyword.t --- a/tests/test-keyword.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-keyword.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,4 +1,4 @@ - $ "$TESTDIR/hghave" symlink unix-permissions || exit 80 + $ "$TESTDIR/hghave" symlink unix-permissions serve || exit 80 $ cat <> $HGRCPATH > [extensions] diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-known.t --- a/tests/test-known.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-known.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,3 +1,4 @@ + $ "$TESTDIR/hghave" serve || exit 80 = Test the known() protocol function = diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-largefiles.t --- a/tests/test-largefiles.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-largefiles.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,4 +1,4 @@ - $ "$TESTDIR/hghave" symlink unix-permissions || exit 80 + $ "$TESTDIR/hghave" symlink unix-permissions serve || exit 80 $ cat >> $HGRCPATH < [extensions] diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-mq-qclone-http.t --- a/tests/test-mq-qclone-http.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-mq-qclone-http.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,3 +1,4 @@ + $ "$TESTDIR/hghave" serve || exit 80 $ echo "[extensions]" >> $HGRCPATH $ echo "mq=" >> $HGRCPATH diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-mq-qimport.t --- a/tests/test-mq-qimport.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-mq-qimport.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,3 +1,4 @@ + $ "$TESTDIR/hghave" serve || exit 80 $ cat > writelines.py < import sys diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-pull-http.t --- a/tests/test-pull-http.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-pull-http.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,3 +1,4 @@ + $ "$TESTDIR/hghave" serve || exit 80 $ hg init test $ cd test diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-pull.t --- a/tests/test-pull.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-pull.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,3 +1,5 @@ + $ "$TESTDIR/hghave" serve || exit 80 + $ hg init test $ cd test diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-push-http.t --- a/tests/test-push-http.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-push-http.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,3 +1,4 @@ + $ "$TESTDIR/hghave" serve || exit 80 $ hg init test $ cd test diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-rollback.t --- a/tests/test-rollback.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-rollback.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,3 +1,5 @@ + $ "$TESTDIR/hghave" serve || exit 80 + setup repo $ hg init t $ cd t diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-schemes.t --- a/tests/test-schemes.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-schemes.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,3 +1,4 @@ + $ "$TESTDIR/hghave" serve || exit 80 $ cat <> $HGRCPATH > [extensions] diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-serve.t --- a/tests/test-serve.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-serve.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,3 +1,4 @@ + $ "$TESTDIR/hghave" serve || exit 80 $ hgserve() > { diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-share.t --- a/tests/test-share.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-share.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,3 +1,4 @@ + $ "$TESTDIR/hghave" serve || exit 80 $ echo "[extensions]" >> $HGRCPATH $ echo "share = " >> $HGRCPATH diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-static-http.t --- a/tests/test-static-http.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-static-http.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,3 +1,4 @@ + $ "$TESTDIR/hghave" serve || exit 80 $ hg clone http://localhost:$HGPORT/ copy abort: error: Connection refused diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-subrepo-relative-path.t --- a/tests/test-subrepo-relative-path.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-subrepo-relative-path.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,3 +1,5 @@ + $ "$TESTDIR/hghave" serve || exit 80 + Preparing the subrepository 'sub' $ hg init sub diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-transplant.t --- a/tests/test-transplant.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-transplant.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,3 +1,5 @@ + $ "$TESTDIR/hghave" serve || exit 80 + $ cat <> $HGRCPATH > [extensions] > transplant= diff -r 7cbb81c47025 -r c5c9ca3719f9 tests/test-treediscovery-legacy.t --- a/tests/test-treediscovery-legacy.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-treediscovery-legacy.t Mon Nov 07 03:24:53 2011 +0100 @@ -1,3 +1,5 @@ + $ "$TESTDIR/hghave" serve || exit 80 + Tests discovery against servers without getbundle support: $ cat >> $HGRCPATH <