Commit Graph

202 Commits

Author SHA1 Message Date
Idan Kamara
56c14a6116 run-tests: don't count test as succeeded if it failed
regressed around 96f44260c0a0
2011-04-29 20:29:22 +03:00
Matt Mackall
390ca3b942 run-tests: do chdir for tests under a lock for thread safety 2011-04-25 17:01:34 -05:00
Matt Mackall
8e4d999508 run-tests: add iolock to vlog 2011-04-25 16:17:08 -05:00
Patrick Mezard
6be95e16f7 run-tests: display diff before prompting with --interactive 2011-04-25 18:42:31 +02:00
Matt Mackall
b173caf66d run-tests: fix some missing i/o locks 2011-04-24 17:52:46 -05:00
Matt Mackall
ec6c0b4dd8 run-tests: add a lock for console I/O 2011-04-24 16:46:37 -05:00
Matt Mackall
ffa2bfc870 run-tests: switch timeout handling from alarm to helper thread
This should be slightly more portable than signals and be compatible
with threaded dispatch.
2011-04-24 16:42:15 -05:00
Matt Mackall
991f15b761 run-tests: add locking on results struct 2011-04-24 16:42:11 -05:00
Patrick Mezard
35a92ea64b run-tests: fix --interactive (after 6f977fba3d04)
- Do not prompt if there is no .err file
- Fix source and target paths
2011-04-24 23:33:48 +02:00
Matt Mackall
15f893d8b4 run-tests: move test loop into a helper function 2011-04-22 14:04:34 -05:00
Matt Mackall
00e494b835 run-tests: use a results dict 2011-04-22 12:24:22 -05:00
Matt Mackall
1d9ec246c2 run-tests: move blacklist and retest filtering to runone 2011-04-22 11:36:40 -05:00
Matt Mackall
b8baa5e84b run-tests: keep a list of passed tests 2011-04-22 11:32:05 -05:00
Matt Mackall
05c203e160 run-tests: move keyword checking into runone 2011-04-22 11:24:27 -05:00
Matt Mackall
2cd598eec8 run-tests: add ignores list 2011-04-22 11:22:02 -05:00
Matt Mackall
6f64de4f45 run-tests: move existence/name format check into runone 2011-04-21 18:38:30 -05:00
Matt Mackall
938b16055e run-tests: move interactive handling into runone 2011-04-21 18:19:45 -05:00
Matt Mackall
a9372128fb tests: better output on timeouts
Formerly, timeouts would generate huge scrollback-destroying diffs and
weird -15 return codes in the summary. Now we simply report "timed
out".
2011-04-09 15:52:19 -05:00
Idan Kamara
acaa24b982 tests: set HOME to the test temp dir (issue2707) 2011-03-25 22:15:37 +02:00
Patrick Mezard
a0c19fb892 run-tests: handle mixed comment lines in blacklists 2011-03-06 14:19:57 +01:00
Dan Villiom Podlaski Christiansen
ec590d5cd4 explicitly close files
Add missing calls to close() to many places where files are
opened. Relying on reference counting to catch them soon-ish is not
portable and fails in environments with a proper GC, such as PyPy.
2010-12-24 15:23:01 +01:00
Simon Heimberg
8b3f2a286a run-tests: only call WIFEXITED on systems it exists
not on Windows or in jython
2011-02-02 23:21:13 +01:00
Simon Heimberg
eb39d33f61 run-tests: loadable as module 2011-02-01 20:47:05 +01:00
Martin Geisler
6a3d9310ab code style: prefer 'is' and 'is not' tests with singletons 2010-11-22 18:15:58 +01:00
Nicolas Dumazet
7292968c6f run-tests: fix --debug for .t tests
When --debug is given to the test runner, run() returns (retcode, None).
Do not try to use None output as a string, and return directly, similarly
as other testers.
2010-11-16 10:33:19 +09:00
Erik Zielke
fae4edd371 run-test: fixed wrong parenthesis
Fixed wrong placement of end parenthesis, from 8b0591f8d1cd
2010-11-08 10:56:47 +01:00
Mads Kiilerich
82954d10d1 tests: use (esc) markup for string-escape
This makes test output less ambiguous.

Failing test output will be escaped and marked up if necessary. A Python
string-escape compatible encoding is used, but not everything is encoded -
especially not \n and \t and '.
2010-11-08 01:35:41 +01:00
Mads Kiilerich
8c125f4b6b tests: (no-eol) markup for command output without trailing LF
Output chunks without a trailing LF will now work but get (no-eol) appended.

This change mostly moves code around so we can handle that an output line
starts with data from previous command, followed by salt and the next command.
2010-11-08 01:35:40 +01:00
Mads Kiilerich
2fcf673aef tests: handle .t files without trailing LF
203ffed27f86 made this simple test-test.t succeed silently:
  $ printf '  $ true' > test-test.t
but did not give a usable .err in this case:
  $ printf '  $ false' > test-test.t

The missing LF will now be fixed in the test output and it will thus give a
test failure and a solution in the .err file.
2010-11-06 00:31:44 +01:00
Martin Geisler
23e249a12e run-tests: use regex when searching for $HGPORT in test output
This prevents spurious errors when a changeset hash happens to match
the port number. Before, this invocation gave a test failure:

  $ ./run-tests.py test-log.t --port 24427
  ERROR: /home/mg/src/mercurial-crew/tests/test-log.t output changed
  --- /home/mg/src/mercurial-crew/tests/test-log.t
  +++ /home/mg/src/mercurial-crew/tests/test-log.t.err
  @@ -626,12 +626,12 @@

     $ hg log -b default
     changeset:   2:c3a4f03cc9a7
  -  parent:      0:24427303d56f
  +  parent:      0:$HGPORT303d56f
     user:        test
     date:        Thu Jan 01 00:00:00 1970 +0000
     summary:     commit on default

  ...
2010-11-01 10:24:07 +01:00
Yuya Nishihara
65ec94ef86 tests: accept \-escaped test output
It changes tsttest to accept expected outputs in python-style \-escapes.
It aims to avoid trouble with outputs for non-ascii, color and progress
tests.
2010-10-02 22:57:25 +09:00
Benoit Boissinot
12abbf921a run-tests.py: remove support for .bat files 2010-10-09 16:27:10 -05:00
Benoit Boissinot
941986da07 run-tests.py: do not install hg when the tests do no exist 2010-10-09 16:25:28 -05:00
Mads Kiilerich
e490eeec3f tests: reintroduce ":$HGPORT" in test output
This reduces the number of patterns that must be adjusted when writing tests.
2010-10-08 22:36:11 -05:00
Mads Kiilerich
a6c2677112 tests: replace test tmp directory with $TESTTMP in test output
This reduces the number of patterns that must be adjusted when writing tests.
2010-10-08 22:36:10 -05:00
Patrick Mezard
6332560a4d run-tests: handle .tst not ending with an LF 2010-10-08 17:00:38 -05:00
Thomas Arendsen Hein
a05671580d tests: show skip reason instead of "irrelevant" with unified tests, too
parsehghaveoutput expects just the test output, not the merged test/output,
so for skipped unified tests e.g.:
Skipped test-convert-darcs.t: missing feature: irrelevant
was shown instead of:
Skipped test-convert-darcs.t: missing feature: darcs client
2010-09-27 22:49:30 +02:00
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