Mercurial > hg-stable
changeset 15446:c5c9ca3719f9
tests: use 'hghave serve' to guard tests that requires serve daemon management
line wrap: on
line diff
--- 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"),
--- 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
--- 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]
--- 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
--- 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
--- 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 =
--- 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
--- 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
--- 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
--- 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
--- 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
--- 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
--- 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
--- 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
--- 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.
--- 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'
--- 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 <<EOF >> $HGRCPATH > [extensions] > highlight =
--- 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 $@
--- 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
--- 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
--- 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
--- 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' | \
--- 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 &
--- 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
--- 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
--- 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
--- 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 <<EOF >> $HGRCPATH > [extensions]
--- 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 =
--- 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 <<EOF > [extensions]
--- 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
--- 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 <<EOF > import sys
--- 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
--- 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
--- 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
--- 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
--- 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 <<EOF >> $HGRCPATH > [extensions]
--- 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() > {
--- 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
--- 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
--- 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
--- 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 <<EOF >> $HGRCPATH > [extensions] > transplant=
--- 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 <<EOF
--- a/tests/test-treediscovery.t Mon Nov 07 03:14:55 2011 +0100 +++ b/tests/test-treediscovery.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: $ CAP=getbundle