Commit Graph

165 Commits

Author SHA1 Message Date
Martin Geisler
7313d940be run-tests: move build/ directory to HGTMP
Before, running a test would give you a build/ directory in the root
of your Mercurial source tree. The directory had a full copy of the
the source, so a grep in '**/*.py' would find files inside build/.
2010-09-26 22:22:59 +02:00
Matt Mackall
430e769c2b tests: various fixes for new unified test pattern format 2010-09-22 18:20:47 -05:00
Brodie Rao
b5fe0d906e tests: add glob matching for unified tests
This adds a " (glob)" marker that works like a simpler version of
(re): "*" is converted to ".*", and "?" is converted to ".".

Both special characters can be escaped using "\", and the backslash
itself can be escaped as well.

Other glob-style syntax, like "**", "[chars]", or "[!chars]", isn't
supported.
2010-09-22 16:06:02 -05:00
Brodie Rao
7d7d96bd74 tests: require regexes in unified tests to be marked with " (re)"
Consider this test:

  $ hg glog --template '{rev}:{node|short} "{desc}"\n'
  @  2:20c4f79fd7ac "3"
  |
  | o  1:38f24201dcab "2"
  |/
  o  0:2a18120dc1c9 "1"

Because each line beginning with "|" can be compiled as a regular
expression (equivalent to ".*|"), they will match any output.

Similarly:

  $ echo foo


The blank output line can be compiled as a regular expression and will
also match any output.

With this patch, none of the above output lines will be matched as
regular expressions. A line must end in " (re)" in order to be matched
as one.

Lines are still matched literally first, so the following will pass:

  $ echo 'foo (re)'
  foo (re)
2010-09-22 16:06:00 -05:00
Brodie Rao
548fb65104 tests: ensure regexes match to the end of the string
Regular expressions in the test suite are currently written assuming
that you need a trailing ".*" to avoid matching to the end.

Instead of matching regular expressions using "^pattern", this patch
makes matching more restrictive by matching "^pattern$".
2010-09-22 16:05:59 -05:00
Brodie Rao
94cd8c2067 tests: don't match blank output lines as regexes in unified tests
Currently, the following unified test will pass:

  $ echo foo


A blank output line (a line containing just two spaces) will match any
output.

The patch modifies the unified test runner to ignore empty strings
strings when do regular expression matching.
2010-09-22 16:05:59 -05:00
Matt Mackall
82d0edffe9 tests: add hack to avoid problem with graphlog in unified tests 2010-09-20 14:36:36 -05:00
Matt Mackall
08439e0f2d tests: add exit codes to unified tests 2010-09-16 17:51:32 -05:00
Nicolas Dumazet
5dc0fd0772 tests: catch re.error if test line is not a valid regular expression 2010-08-12 14:53:34 +09:00
Matt Mackall
0e5ee51c54 tests: basic support for unified tests 2010-08-02 23:27:22 -05:00
Matt Mackall
fb4712adac tests: move script execution in runner helpers 2010-08-02 15:44:54 -05:00
Matt Mackall
a7793f368b run-tests: add --view switch to use external diff viewer 2010-04-29 22:04:05 -05:00
Matt Mackall
78b7ce514d run-tests: sort options 2010-04-29 18:25:45 -05:00
Matt Mackall
0beeabc59e run-tests: add -l short option for --local 2010-04-29 18:25:45 -05:00
Benoit Boissinot
443d0248ba merge with stable 2010-04-15 20:25:26 +02:00
Benoit Boissinot
d2fd3d1bf8 run-tests.py: can't remove from os.environ on solaris 2010-04-15 20:25:07 +02:00
Benoit Boissinot
02bda9ab1a merge with stable 2010-04-14 11:27:15 +02:00
Ry4an Brase
24ead01860 Fix --blacklist when --jobs > 1 in run_tests.py.
The options parsing logic replaces the options.blacklist initial value,
a list of filenames, with a dict of test names to filenames.  When
runchildren rebuilds the command line to launch child processes the dict
is flattened and provided as a malformed argument when a filename is
expected.

Fix is to remove the blacklist option from child invocations since the
filtering is handled in the parent anyway.
2010-04-14 00:24:47 -05:00
Benoit Boissinot
4ae674da0c run-tests.py: reset env variables set by hooks 2010-04-14 09:08:47 +02:00
Nicolas Dumazet
7f1a963829 pylint, pyflakes: remove unused or duplicate imports 2010-04-14 17:58:10 +09:00
Benoit Boissinot
18b2a0f2b6 merge with stable 2010-04-14 09:09:43 +02:00
Ronny Pfannschmidt
1bc07ba5f1 run-tests: force to test pure on pypy as well 2010-03-23 15:23:04 +01:00
Ronny Pfannschmidt
344c277e33 Fix run-tests.py -jX after c0b2d15b7cd0 2010-03-23 15:22:17 +01:00
Ronny Pfannschmidt
bc5eda7fb9 tests: adapt the test runner to work with jython 2010-03-23 11:37:31 +01:00
Brodie Rao
b47433e334 run-tests: make sure GREP_OPTIONS isn't set
This can interfere with test output, especially for options like --color.
2010-03-22 01:36:12 -04:00
Dirkjan Ochtman
0fd3b50af0 tests: use external coverage, mandate newer version
This removes the option for including the stdlib in coverage reports.
2010-03-11 15:32:24 +01:00
Matt Mackall
a2acbc421b fix up a bunch of check-code warnings 2010-02-09 14:12:22 -06:00
Mads Kiilerich
487f13afcd run-tests.py: skipped tests shouldn't change working directory 2010-02-09 01:12:29 +01:00
Brendan Cully
af14f4f0ed run-tests: kill daemons on ^C with -j.
This is not perfect, but the problem is fundamentally racy.
2010-02-06 15:18:36 +01:00
Nicolas Dumazet
f6e8bdddc7 run-tests: split tests/blacklist in tests/blacklists/*
Following discussions with Gilles Morris [1], it seems that it is preferable to
use several blacklist files in a blacklists/ directory. It is easier to add an
unversioned file for experiments than modifying a tracked file.

Also fall back to a simpler syntax, giving up ConfigParser, now that section
names are not needed anymore.

And allow --blacklist parameter to be a complete path, instead of only one
of the filenames contained in tests/blacklists/


[1] http://www.selenic.com/pipermail/mercurial-devel/2009-December/017317.html
2009-12-10 17:21:31 +09:00
Matt Mackall
8d99be19f0 many, many trivial check-code fixups 2010-01-25 00:05:27 -06:00
Matt Mackall
cd3ef170f7 Merge with stable 2010-01-19 22:45:09 -06:00
Matt Mackall
595d66f424 Update license to GPLv2+ 2010-01-19 22:20:08 -06:00
Wagner Bruna
1f5640533e run-tests.py: clears http_proxy for all tests 2009-12-29 19:02:26 -02:00
Matt Mackall
de8a538d3a Merge stable heads 2009-11-25 21:54:18 -06:00
Wagner Bruna
8fc5f3b74f run-tests: LANGUAGE may make tests fail 2009-11-24 13:55:13 -02:00
Benoit Boissinot
61f5eea9d1 run-tests: always set $COLUMNS, fix running tests under emacs shell
fix tests failure reported by Neal Becker.
2009-11-23 22:45:36 +01:00
Greg Ward
939861b0bd run-tests: give each child its own tmp dir (issue1911)
Fixes bug introduced by 40ac669fd6c2 (issue1911: --tmpdir plus parallel
mode = fail), and also fixes the long-standing quirk that parallel mode
created multiple /tmp/hgtests.XXXXXX directories.  Now there is only one
/tmp/hgtests.XXXXXX, with child0, child1, etc. under it.
2009-11-18 22:23:11 -05:00
Greg Ward
8ce4dc3093 run-tests: add "debug" mode: don't capture child output, just show it.
In debug mode, we:
- don't try to diff expected vs actual output
- disallow --interactive
- disable timeouts (warn if user tried to supply one)
- don't try to parse hghave output, since we don't have the output
- don't try to save output to .err file
2009-11-02 17:06:11 -05:00
Greg Ward
000c454c9a run-tests: make --tmpdir option more useful.
- instead of creating HGTMP inside tmpdir, now HGTMP is tmpdir
  (thus, fail if tmpdir already exists)
- passing --tmpdir automatically turns on --keep-tmpdir
2009-11-02 17:06:10 -05:00
Matt Mackall
7d81f1588d tests: add -k to test scripts matching keywords
argument is a space-separated list of keywords that are searched for
in the name and body of each test. This makes it easy to run only
tests related to tags, hgweb, revert, etc. (eg -k "tag hgweb revert").
2009-10-12 14:52:53 -05:00
Matt Mackall
ba7d982f34 run-tests: add --noskips option 2009-10-11 13:58:53 -05:00
Martin Geisler
3fd04b36b0 run-tests: standardize on --foo instead of -f/--foo
We write -f/--foo in Mercurial help texts (docstrings), but I think it
looks strange in error messages.
2009-08-28 20:53:03 +02:00
Martin Geisler
bfa92eb996 run-tests: use parser.error for cmdline option errors 2009-08-28 20:50:54 +02:00
Nicolas Dumazet
857382a916 run-tests: expand --tmpdir and create it if needed 2009-08-15 21:19:57 +09:00
Alejandro Santos
77d606ac51 compat: use open() instead of file() everywhere 2009-07-05 11:01:30 +02:00
Alejandro Santos
c0dcbaabfe tests: add -3 switch to run-tests.py 2009-07-05 10:59:54 +02:00
Greg Ward
e0eb715075 run-tests: use os.path.realpath() to find hg's setup.py.
Needed for running out-of-tree test suites without --with-hg/--local.
2009-06-23 22:20:54 -04:00
Dirkjan Ochtman
605b944edf kill trailing whitespace 2009-06-19 13:47:50 +02:00
Brendan Cully
167122c387 Unbreak run-tests support for out-of-tree extensions 2009-06-06 15:38:03 -07:00