Commit Graph

314 Commits

Author SHA1 Message Date
Matt Mackall
fde01215f9 run-tests: fix a path existence check 2013-05-24 13:52:05 -05:00
Matt Mackall
8bd32fc6fa run-tests: regroup some variable initialization 2013-05-24 13:51:20 -05:00
Matt Mackall
037d2bf78a run-tests: regroup nested functions 2013-05-24 13:48:25 -05:00
Matt Mackall
f100d35303 run-tests: regroup temp dir creation 2013-05-24 13:47:17 -05:00
Matt Mackall
2180875dae run-tests: pull hgrc creation out as function 2013-05-24 13:41:20 -05:00
Matt Mackall
027e99d223 tests: simplify handling of unknown test types 2013-05-24 13:34:22 -05:00
Matt Mackall
506ab062fd run-tests: filter out non-tests from default list 2013-05-24 13:31:44 -05:00
Matt Mackall
a7060ace56 run-tests: make a table of test types 2013-05-24 13:23:19 -05:00
Matt Mackall
8448d1f531 run-tests: don't need to test shebang any more 2013-05-24 13:02:00 -05:00
Siddharth Agarwal
ff171329ff run-tests: when running in parallel, delete tmpdirs immediately
This is especially important if extensions that use inotify are enabled,
because it's very easy to hit the inotify max_user_instances limit without
this.
2013-05-03 15:18:21 -07:00
Mads Kiilerich
048869f652 run-tests: introduce --random for running tests in random error
This is convenient when investigating failures one by one to avoid running the
same fixed tests first every time.
2013-04-17 03:41:34 +02:00
Simon Heimberg
b13fb73963 run-tests: only sort files when not given as argument
os.listdir returns the files in any order. This has to be sorted.
But when given as argument, the user should be allowed to set any order.

This restores the behaviour before 9848a94e2a.
2013-03-21 08:56:21 +01:00
Durham Goode
47346e366e tests: fix test-profile to not depend on HGPROF environment variable
The test-profile test would fail if the user had HGPROF set to another
profiler in their environment.  This fix makes the test independent of
that environment variable.

Reverts the previous attempt to fix this, which was not cross platoform.
2013-03-12 10:37:48 -07:00
Simon Heimberg
bf363c5722 tests: inform on Windows about unnecessary glob lines
When glob lines directly match on windows, "/" (and not "\") was output in the
path on the line. No glob matching is necessary in this case.

The test output will look like this (when 5 tests have passed and no 4 has an
unnecessary glob):
...
Info, unnecessary glob: info about some/thing (glob)
..
2012-10-15 23:28:45 +02:00
Simon Heimberg
5a3ca8f2da tests: quickly check if the glob line already matches the output
This happens when a path with "/" as only glob char is matched on a non windows
platform. (Currently one third of all glob matches.)
The slowdown on windows and the speedup on other os are neglectable.
2013-02-13 21:58:52 +01:00
Pierre-Yves David
f22102a0c8 test: display used python hash seed
We keep using a random seed for each run, but we "compute" it ourself to be able
to reproduce a failed test run.
2013-01-30 01:24:04 +01:00
Simon Heimberg
246a2ad9d9 run-tests: do not fail on empty tsttest file
Initialize n for not failing on empty tsttest files.
2012-10-24 23:09:31 +02:00
Mads Kiilerich
e8e2c1e1fe run-tests.py: inherit PYTHONHASHSEED from environment if set
This makes it possible to fix the seed by using for instance
  PYTHONHASHSEED=7 ./run-tests.py ...

This can be very convenient when trying to debug problems that are influenced
by hash values. Try different seed values until you find one that triggers the
bad behaviour and then keep that while debugging.

The value 0 will restore default Python behavior and disable randomization.
2013-01-29 20:03:51 +01:00
Mads Kiilerich
77be3a8c23 run-tests.py: don't let hg run interactively in debug mode
In normal test mode stdin is closed and hg is thus not interactive. In --debug
mode stdin is inherited from the running console and to the tests, and hg could
thus wait in prompts when running on Windows.

See http://selenic.com/pipermail/mercurial-devel/2013-January/047548.html .

Instead set ui.interactive=False to make Mercurial non-interactive. Other
commands might still work differently in the --debug environment.

This should solve the problem with hg waiting for input but still make it
possible to add --debugger to hg in a test and run run-tests.py with --debug.
2013-01-18 01:23:51 +01:00
Mads Kiilerich
bc377e8673 run-tests.py: backout "don't use console for stdin when running in debug mode"
3951b91555f7 caused that some kind of interactive debugging no longer was
possible - such as running hg with --debugger in a test run with run-tests.py
--debug .
2013-01-18 01:16:16 +01:00
Mads Kiilerich
8a6ac13827 tests: run with PYTHONHASHSEED=random
Python set and dict iteration order is in principle undefined but usually
'quite stable'. Setting PYTHONHASHSEED=random will make the iteration order
more random in Python 2.6.8 and 2.7.3 and where it has been backported. This
can thus help spot dependencies on undefined behaviour and prevent future
problems.
2013-01-15 23:30:10 +01:00
Bryan O'Sullivan
a6ed57115c run-tests: exit cleanly if parallel run is interrupted
If interrupted while running with "--jobs N", run-tests asynchronously
spewed a bunch of output and backtraces from both the master and
slave processes, leaving the terminal full of goop. This patch makes
it behave more sensibly.
2013-01-15 13:33:28 -08:00
Mads Kiilerich
1c79de5503 run-tests.py: fix handling of symlink to the right python
Before: a symlink for python in BINDIR was sometimes created, but it was never
updated when a different Python was used and it was never removed. An invalid
python could thus be left around and used when testing with --local.

Now: the symlink is removed when wrong and created when necessary.

The mechanism for finding the right name (python or python.exe) also had to be
simplified and made more explicit.
2013-01-07 02:14:41 +01:00
Mads Kiilerich
6298fa2cbc run-tests.py: don't use console for stdin when running in debug mode
Tests would wait for input instead of using non-interactive mode.
2013-01-07 02:00:43 +01:00
Mads Kiilerich
d68f8e1916 tests: make hghave and run-tests exit on unknown feature requirements 2013-01-07 02:00:43 +01:00
Bryan O'Sullivan
b9868468a6 run-tests: fix whitespace nonsense 2012-12-12 15:17:18 -08:00
Bryan O'Sullivan
d3fb3d216e merge with mpm 2012-12-12 15:12:28 -08:00
Bryan O'Sullivan
5b99de5a51 run-tests: on windows, put correct python at front of PATH
The older approach of trying to copy the python executable into the test
directory was doomed to fail.

There remains one weakness with this approach: if you've run "make local",
tests may pick up the wrong extension DLLs from inside the source tree. I
don't know why this happens.

A reasonable workaround for now is to test either using --local or with
a working directory that does not contain built DLLs.
2012-12-12 14:52:58 -08:00
Siddharth Agarwal
7451427eba run-tests: fix exename on Windows 2012-12-11 15:38:42 -08:00
Bryan O'Sullivan
9547883e85 run-tests: support running tests in parallel on windows
Previously, we used os.spawnvp, which doesn't exist on Windows, and
isn't needed anyway (the command line begins with an absolute path).

We also need a slightly more convoluted way to wait for processes
without specifying an order on Windows, as it lacks os.wait.
2012-12-11 15:13:23 -08:00
Bryan O'Sullivan
f09ee98abc run-tests: use correct python safely under --jobs 2012-12-10 12:14:55 -08:00
Bryan O'Sullivan
1fda6e9b5e run-tests: check for the correct python when starting 2012-12-10 12:09:02 -08:00
Bryan O'Sullivan
ae96fc1e0d run-tests: use correct python when run with --local 2012-12-10 12:07:42 -08:00
Mads Kiilerich
eb895c5533 tests: kill daemons early, making breaking at "Accept" prompt safe 2012-12-09 23:33:16 +01:00
Bryan O'Sullivan
ad58c7ca08 run-tests: fix an unnoticed check-code violation 2012-11-27 13:09:05 -08:00
Bryan O'Sullivan
d0279e495a run-tests: add a --compiler option
Without this option, it is not possible to run the test suite on Windows
using mingw's gcc as the compiler.
2012-11-27 11:18:33 -08:00
Bryan O'Sullivan
6fbbd59476 run-tests: make build command line less intimidating
Use a dict for parameters to the format string, instead of a
ridiculous number of positional parameters.
2012-11-27 11:18:31 -08:00
Matt Mackall
0dddda7cc8 run-tests: backout b3100dcfd155
This deleted work in progress to eliminate child processes for -j.
2012-11-14 18:08:39 -06:00
Siddharth Agarwal
e710e102e4 run-tests.py: remove runqueue's results parameter since it is now a global 2012-11-08 14:10:04 -08:00
Siddharth Agarwal
19a33f47fb run-tests: open child-parent pipes in binary mode
Python's pickle is a binary format.
2012-11-10 11:37:41 -08:00
Siddharth Agarwal
0f4a538ae3 run-tests: add --time option to log times for each test
--time also prints out the wall-clock time each test takes in descending order.
2012-11-09 14:49:30 -08:00
Siddharth Agarwal
1e050996f6 run-tests: remove resultslock since it serves no useful purpose
Each child process has its own copy of the results dict, so all access to the results dict is serial.
2012-11-09 15:09:35 -08:00
Siddharth Agarwal
c3f43bc1f7 run-tests: use pickle to send results from children to parent
JSON would probably be preferable, but it isn't available for Python 2.4 or 2.5.
2012-11-09 14:42:36 -08:00
Simon Heimberg
d277fc55af run-tests: skip unnecessary operations on the args in the child proces
The arguments are already sorted and never empty.
2012-10-24 23:09:31 +02:00
Mads Kiilerich
7e19bad572 run-tests: remove dead code for supporting old test scripts 2012-10-18 00:44:32 +02:00
Mads Kiilerich
1c2faf6c4c run-tests: handle windows crlf in .py tests again
Before a55b74d8de3a all crlf occurrences in test output on Windows were simply
changed to lf. In a55b74d8de3a it was replaced by more clever handling in the
.t test runner ... but the .py runner was forgotten and many .py tests were
failing on Windows.

The crlf/lf replacement is now reintroduced in the py test runner.
2012-10-18 00:33:29 +02:00
Mads Kiilerich
1aa09f180d run-tests: make it possible to combine (esc) with (glob) and (re)
This makes it possible to combine the annotations ... if done in the right
order.
2012-10-14 18:30:42 +02:00
Mads Kiilerich
ffdf739c4d run-tests: alternative way of handling \r on Windows
After d5471ad04cf6 all \r was stripped from output on Windows, and the places
where a \r explicitly was expected it was accepted that it was missing. Ugly
hack.

Instead we now accept that an extra \r might appear at the end of lines on
Windows. That is more to the point and less ugly.
2012-10-15 02:33:12 +02:00
Bryan O'Sullivan
5e8ce6dc50 tests: correctly report a test killed by a signal 2012-10-11 16:05:14 -07:00
Mads Kiilerich
f815002da3 run-tests: allow test output lines to be terminated with \r in addition to \n
str.splitlines could not be used in 2d839579ce70, but _now_ we would like to
have lines with other line endings than \n.

Some fine occurences of (esc) markup of \r is replaced with multiple lines
ending with '\r (no-eol) (esc)'.  That is no win but also no significant loss.

This change makes it possible to drop filtercr.py - _that_ is a win.
2012-09-26 00:56:27 +02:00