Comments
Patch
@@ -2,39 +2,49 @@
This file tests the behavior of run-tests.py --rev.
+ $ . "$TESTDIR/helper-runtests.sh"
$ . "$TESTDIR/helpers-testrepo.sh"
Avoid interference from actual test env:
- $ unset HGTEST_JOBS
- $ unset HGTEST_TIMEOUT
- $ unset HGTEST_PORT
- $ unset HGTEST_SHELL
+ $ echo "#require slow" > avoid-interference
+ $ echo " \$ . '$TESTDIR/helper-runtests.sh'" >> avoid-interference
+ $ echo " \$ . '$TESTDIR/helpers-testrepo.sh'" >> avoid-interference
support for running a different version of mercurial
note that it is typical for ~1/5 tests not to pass when using older
versions of mercurial...
- $ cat >> test-version.t <<EOF
- > $ hg version
- > Mercurial Distributed SCM (version 1.2)
- >
- > Copyright (C) 2005-2008 Matt Mackall <mpm@selenic.com> and others
- > This is free software; see the source for copying conditions. There is NO
- > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- > EOF
- $ run-tests.py --pure --rev 1.2 test-version.t
- .
- # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
+ $ cp avoid-interference test-version-rev.t
+ $ cat >> test-version-rev.t <<EOT
+ > $ cat >> test-version.t <<EOF
+ > > $ hg version
+ > > Mercurial Distributed SCM (version 1.2)
+ > >
+ > > Copyright (C) 2005-2008 Matt Mackall <mpm@selenic.com> and others
+ > > This is free software; see the source for copying conditions. There is NO
+ > > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ > > EOF
+ > $ run-tests.py --pure --rev 1.2 test-version.t
+ > .
+ > # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
+ > EOT
To run tests at a version from the revision you select from --rev
you need a test which introspects the source directory
- $ cat > test-old-basic.t <<EOF
- > $ run-tests.py --pure --local ../../source/tests/test-basic.t
+ $ cp avoid-interference test-old-basic-rev.t
+ $ cat >> test-old-basic-rev.t <<EOT
+ > $ cat > test-old-basic.t <<EOF
+ > > $ run-tests.py --pure --local ../../source/tests/test-basic.t
+ > > .
+ > > # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
+ > > EOF
+ > $ run-tests.py --pure --rev 1.7 test-old-basic.t
> .
> # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
- > EOF
- $ run-tests.py --pure --rev 1.7 test-old-basic.t
- .
- # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
+ > EOT
+
+ $ run-tests.py -l -j2 --allow-slow test-version-rev.t test-old-basic-rev.t
+ ..
+ # Ran 2 tests, 0 skipped, 0 warned, 0 failed.