Commit Graph

165 Commits

Author SHA1 Message Date
Dirkjan Ochtman
5912c48b40 tests: delete parallel coverage files after combining 2009-06-03 14:10:36 +02:00
Greg Ward
e8d6180038 run-tests: don't replace PYTHONPATH, just augment it.
(Needed at least for Subversion bindings on OS X, which are in
/opt/subversion.  Useful for other external libraries installed in
non-standard places too.)
2009-06-01 09:18:35 -04:00
Greg Ward
3dc47b69c7 run-tests: redefine --with-hg so it takes the 'hg' script to run.
- in parseargs(), check that --with-hg value is valid
- add handy --local option for "--with-hg=../hg"
- ensure that we always set PATH and PYTHONPATH (not just
  when doing a temporary install)
- override any existing PYTHONPATH, so test success does not
  depend on whatever happens to be in the caller's environment
- give tests a little more control by exporting $PYTHON to the
  environment; needed by test-convert and test-mergetool when
  they run hg with a stripped-down $PATH

Also, add a big comment explaining all the corner cases to test for the
next person who tries to modify this script.
2009-05-31 15:20:31 -04:00
Greg Ward
2cb745bb8b run-tests: fix _checkhglib() so it's correct when using --with-hg.
Since this makes the warning less likely, upgrade it to a "real"
warning to stderr.
2009-05-29 22:18:16 -04:00
Greg Ward
47093c6314 run-tests: factor out _checkhglib() to check import path of 'mercurial'.
- rename _hgpath() to _gethgpath() and move it down next to _checkhglib()
- change _gethgpath() so it caches its result: replaces global 'hgpkg'
  that anyone can use with global '_hgpath' that is only for _gethgpath()
- no need to pass 'expecthg' to runchildren() or runtests() anymore

Also: do not change global PYTHON when doing coverage; this seems to
be unnecessary, since we create a dummy 'hg' script that handles
coverage for us, and it made things brittle.  (E.g. the rest of this
patch makes the call to _hgpath() come later, and it was broken by
enabling coverage.)
2009-05-29 22:18:15 -04:00
Greg Ward
3c6e4e3061 run-tests: show PID if running in parallel mode with -v.
(Extremely handy when you break parallel operation and need to figure
out what's going on.  The assumption is that if you run with -v, you
want more details.)
2009-05-29 22:17:53 -04:00
Greg Ward
4ad6973308 run-tests: clarify timeout log message. 2009-05-29 10:00:03 -04:00
Dirkjan Ochtman
f9911763f7 tests: make coverage run in parallel mode, clean up coverage code 2009-05-25 18:34:35 +02:00
Simon Heimberg
293c5101a0 runtest: do not start testing when there is no test 2009-05-19 09:36:20 +02:00
Matt Mackall
ea0baf43e7 Merge with stable 2009-12-29 16:16:25 -06:00
Mads Kiilerich
8c4a04a32f run-tests.py: Show paths to failing tests, .err and .out
I think this is very convenient when investigating and fixing test failures,
but perhaps it must be tweaked further to show paths if and only if
it is appropriate.
2009-12-16 12:09:25 +01:00
Martin Geisler
8222ff8d65 run-tests: backout 255e2d0db0a0
We no longer have any data files, so this is no longer needed. Augie
Fackler reported on IRC that this "hack" had never worked for him in
the first place.
2009-12-10 22:31:10 +01:00
Martin Geisler
18e6420547 run-tests: install data files correctly
In 47cfa8aa4b94 we began installing some data files in PREFIX/share.
When preparing to run the tests, run-tests.py uses --home="" in order
to work around home being set in a ~/.pydistutils.cfg file. This
somehow overwrites the --prefix option.

The result was that the share/ directory was installed in the top of
the Mercurial source tree.
2009-12-05 23:16:09 +01:00
Nicolas Dumazet
cfa46404dd run-tests: --inotify: use inotify.appendpid to append pids to $DAEMON_PIDS
Introduce a inotify.appendpid configuration possibility that appends pids
to inotify.pidfile when set to True.
2009-12-01 09:53:02 +09:00
Nicolas Dumazet
dbb0900cef run-tests: add a "--blacklist target" option to skip predefined test lists
Rely on a ConfigParser file, tests/blacklist, to define blacklist targets.
This allows exposing specific test suites for testing incomplete/particular
features, e.g. "run-tests.py --blacklist inotify-failures --inotify *"
2009-11-28 10:25:09 +09:00
Nicolas Dumazet
668d6309cd run-tests: add --inotify option to test runner
Activate inotify extension when running tests.
2009-11-17 18:50:39 +09:00
Matt Mackall
6e437a885e Merge with stable 2009-11-25 21:44:19 -06:00
Benoit Boissinot
d10833a376 merge with stable 2009-11-23 23:04:44 +01:00
Patrick Mezard
7126e1ad0c run-tests: work around a distutils bug triggered by 6051ab49563b 2009-11-22 19:11:12 +01:00
Greg Ward
285692daf3 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
Dan Villiom Podlaski Christiansen
aa1a241eb2 run-tests: set --home when building with distutils
If home was set in ~/.pydistutils.cfg, the tests could not run. This
overrides any home setting by supplying --home="" on the command line.
2009-11-17 13:24:58 +01:00
Matt Mackall
fa65ae0679 remove deprecated rawcommit 2009-05-14 13:20:40 -05:00
Martin Geisler
11190d5aaa util: always use subprocess 2009-05-02 23:05:35 +02:00
Bryan O'Sullivan
092a707d59 run-tests.py: ensure that hgpkg is always visible 2009-04-24 14:40:56 -07:00
Martin Geisler
750183bdad updated license to be explicit about GPL version 2 2009-04-26 01:08:54 +02:00
Simon Heimberg
36693ceb6a run-tests: cosmetics 2009-04-22 15:49:33 +02:00
Simon Heimberg
e9ecbcc326 run-tests: fix error when timeout occurs 2009-04-22 09:11:46 +02:00
Benoit Boissinot
3da3b1d1e0 run-tests: fix -jN broken by eb47f6866e97 2009-04-22 01:53:15 +02:00
Martin Geisler
f3f344d0c5 run-tests: removed some underscores (coding style) 2009-04-21 11:19:10 +02:00
Martin Geisler
6f1fe4b8fc run-tests: upper-case global PYTHON variable 2009-04-21 10:53:42 +02:00
Greg Ward
7b736bed65 run-tests: reduce global variables set by parse_args(). 2009-04-20 21:50:11 -04:00
Greg Ward
e0391753e2 run-tests: factor out main(); reduce use of globals a bit. 2009-04-20 21:42:20 -04:00
Greg Ward
2f2a34c5e7 run-tests: move bits of main program so it's all at the bottom. 2009-04-20 21:10:39 -04:00
Greg Ward
5de1444cff run-tests: move _hgpath() up so it's not in the middle of the main program. 2009-04-20 21:07:05 -04:00
Greg Ward
0f9eca8100 run-tests: factor out parse_args(). Clarify use of globals a bit. 2009-04-20 21:04:24 -04:00
Nicolas Dumazet
36eacb3699 run-tests: detect when hghave fails to check for a feature and fail test
hghave exitcode != 0 might mean that hghave failed to check for feature
avaibility. Detect those cases, and fail the test, instead of skipping it.
2009-04-08 02:38:23 +09:00
Mads Kiilerich
2694fdc1a4 run-tests.py: avoid using popen2.Popen4 - use subprocess instead
Use subprocess to emulate Popen4 if available - similar to how it is done in
util.py.

Using popen2 under python 2.6 gives
DeprecationWarning: The popen2 module is deprecated.  Use the subprocess module.
2009-02-27 19:10:38 +01:00
Frank Wierzbicki
975c4301af tests: use same popen strategy for jython as for nt 2009-02-18 13:19:30 +01:00
Mads Kiilerich
d6ab2f95b5 test-merge-tool: Make sure no hgmerge can be found in $PATH
The merge tool selecting algorithm is hardcoded to look for hgmerge in $PATH
before it falls back to use internal merge. This fixes the test for this
fallback to be tolerant to existing hgmerges.
2009-02-10 22:47:38 +01:00
Jim Correia
652c76f46a Account for symlinks when setting up HGTMP.
On Mac OS X, several top-level directories are actually symlinks into
/private. When setting up HGTMP, expand the symlinks so that later
comparisons to or substituations with the actual path work as expected.
2009-01-25 14:12:41 -05:00
Martin Geisler
8fdb89c045 run-tests: add --pure flag for using pure Python modules 2009-01-31 22:50:18 +01:00
Matt Mackall
003766b33a tests: fix no-diffs option 2008-12-19 16:48:32 -06:00
Thomas Arendsen Hein
94a7bf7e03 Fix non-empty $CDPATH causing failed tests.
If CDPATH contains '.', every cd command prints the target path,
which causes additional output in tests and makes them fail.
2008-12-01 12:11:28 +01:00
Matt Mackall
0edb7d6fe4 run-tests: allow turning off diff display 2008-11-07 16:28:52 -06:00
Matt Mackall
3c69f4c760 run-tests: --interactive overrides -j 2008-10-22 17:34:37 -05:00
Thomas Arendsen Hein
d6b1ca4cb9 Use dummy diffstat in tests and remove older diffstat workaround.
This makes test-notify pass on systems without diffstat installed
or where the diffstat version yields a different output.
2008-10-19 19:03:23 +02:00
Benoit Boissinot
624e32832b run-tests.py: report missing file as an error 2008-10-18 22:44:01 +02:00
Benoit Boissinot
44d89759ff run-tests.py: use --prefix instead of --home
Some SUSE version don't like --home, they fail with:
"error: must supply either home or prefix/exec-prefix -- not both"

this is due to SUSE shipping a distutils.cfg conflicting with --home.
2008-10-18 21:08:44 +02:00
Benoit Boissinot
1dcbb85da7 run-tests.py: fix the check for the hg installation with -jn (n > 1) 2008-09-10 13:52:33 +02:00
Dirkjan Ochtman
8c471ba704 imported patch test-check 2008-09-03 19:01:35 +02:00
Thomas Arendsen Hein
6fbdf04649 run-tests.py: Make tests run with python2.3 if HGTEST_* is set.
optparse of python2.3 does not transform default values to the specified
type so e.g. "HGTEST_JOBS=4" (introduced in b8e8d6b0ae08) causes tests
to abort, because options.jobs is set to '4' instead of the number 4.
2008-06-16 11:37:26 +02:00
Thomas Arendsen Hein
818fb02fb9 run-tests.py: Only one fail message when output changed and error code.
This fixes passing back fail messages mistaken for skip messages when
running with parallel jobs because run_children() only expects one message per
fail.
2008-03-24 22:09:01 +01:00
Thomas Arendsen Hein
702b9172d1 run-tests.py: Allow environment variables to set jobs/timeout/port. 2008-03-23 21:48:38 +01:00
Matt Mackall
f9e70fb40e tests: teach -i about fails list 2008-03-21 15:57:22 -05:00
Benoit Boissinot
3a35d838ed run-tests.py: add a summary of failed tests at the end 2008-03-13 17:39:30 +01:00
Joel Rosdahl
4f8012378a Remove unused imports 2008-03-06 22:23:41 +01:00
Thomas Arendsen Hein
9ff01ae3fe Replaced tab in run-tests.py 2008-03-07 00:01:13 +01:00
Peter Arrenbrecht
85ef77aca1 tests: add --keep-tmp to run-tests.py to debug test environment
When set, you can find the working dir of the test run as a
uniquely named subdirectory of --tmpdir so you can inspect
it.
2008-03-05 08:00:05 +01:00
Matt Mackall
9d996cd13f merge: allow smarter tool configuration
Add [merge-tool] hgrc section with:
 <tool>.executable = name or path (<tool>)
 <tool>.args = args with $local/base/other/output ($local $base $other)
 <tool>.priority = priority (default 0)
 <tool>.binary = handles binary (False)
 <tool>.symlink = handles symlinks (False)
 <tool>.checkconflict = check for conflict markers (False)
 <tool>.premerge = try internal simplemerge (True if not binary or symlink)

Four built-in tools: internal:{merge,local,other,fail}

Add [merge-patterns] section of the form:
 <pattern> = <tool>

Priority of settings is:
 HGMERGE
 merge-patterns
 ui:merge
 merge-tools by priority
 hgmerge, if it can be found

Changes:
 unsuccessful merges leave .orig files
2008-02-03 19:29:05 -06:00
Patrick Mezard
336268093f Merge with crew-stable 2008-01-05 22:52:28 +01:00
Patrick Mezard
47378bdecc Make run-tests.py --interactive work on Windows 2008-01-05 17:55:16 +01:00
Thomas Arendsen Hein
1566cda979 Don't let ui.username override web.contact (issue900)
63beab327d26 introduced using ui.username before web.contact, but this was
never documented and might cause commit accidents.

- Drop web.author (deprecated since 2005)
- Try ui.username or $EMAIL as a fallback to display something useful.
- Update docs for the fallbacks.
2008-01-01 17:07:15 +01:00
Thomas Arendsen Hein
347da85c36 Removed tabs and trailing whitespace in python files 2007-12-29 19:49:48 +01:00
Thomas Arendsen Hein
cb74375be7 Use skipped: instead of hghave: for skipping tests, use this in test-merge-types 2007-12-21 21:50:19 +01:00
Alexis S. L. Carvalho
9877d9e85e run-tests.py: add a default --date "0 0" argument to commit et al
Part of test-tags was modified just to be sure this works.

The change in test-archive-symlinks is necessary to avoid a "helpful"
warning from GNU tar ("implausibly old time stamp 1970-01-01 00:00:00").
2007-11-09 20:21:35 -02:00
Alexis S. L. Carvalho
8dd3103fe5 run-tests.py: don't print a dot for skipped tests 2007-11-09 20:21:35 -02:00
Matt Mackall
c9db98f2e6 tests: tidy up reporting of skipped tests
if not verbose:
 - print 's' rather than '.'
 - pass skipped test reports back to parent for -j
 - report which tests were skipped at the end

- print '.' after test completion
2007-10-19 12:53:43 -05:00
Bryan O'Sullivan
f5b570e3a6 run-tests.py: allow a different temporary directory to be specified 2007-10-05 12:42:52 -07:00
Bryan O'Sullivan
a03fea73e0 Allow tests to run in parallel. 2007-10-05 12:17:01 -07:00
Bryan O'Sullivan
b1622da091 run-tests.py: reorder options alphabetically. 2007-10-05 09:30:02 -07:00
Brendan Cully
2a5ee3fd3f Include . in PYTHONPATH (makes testing unbundled extensions easier) 2007-08-29 17:01:10 -07:00
Brendan Cully
f81247179c Make run-tests.py work when invoked outside of tests.
This makes it usable for unbundled extensions.
2007-08-29 16:50:21 -07:00
Patrick Mezard
6acdd7ff15 run-tests: append PYTHONPATH instead of overwriting it
Optional dependencies like svn bindings not necessarily live in site-packages.
2007-08-27 22:17:51 +02:00
Alexis S. L. Carvalho
de2d9c54e8 run-tests.py: pass --install-scripts to setup.py
This avoids possible problems when the user has a ~/.pydistutils.cfg.
Fixes issue638.  Patch provided by Ralf Schmitt.
2007-08-17 22:43:38 -03:00
Thomas Arendsen Hein
001b7980f8 Remove trailing spaces 2007-08-07 10:24:33 +02:00
Thomas Arendsen Hein
82531f29f5 Add message to test output if a test is aborted due to a timeout.
Without this an aborted test could produce an empty .err file so the diff
looks like as if all lines of the .out files are just missing for some unknown
reason.
2007-08-06 14:45:43 +02:00
Patrick Mezard
a17aa86e69 Add hghave utility and run-tests.py support.
hghave detects system features like symlinks availability at run-time. Tests can be skipped by starting them with:

"$TESTDIR/hghave" symlink || exit 80

The 80 exit status triggers hghave output handling by run-tests.py. Also, tests output can be locally patched on the fly to match reference output.
2007-07-14 18:34:06 +02:00
Patrick Mezard
4e0f588756 run-tests: extract correct status when script terminates with exit 2007-07-14 14:01:11 +02:00
Thomas Arendsen Hein
483231d996 Cleanup of whitespace, indentation and line continuation. 2007-06-19 08:06:37 +02:00
Alexis S. L. Carvalho
2f82b4ffa3 run-tests.py: set ui.slash = True
This should make things easier for pysh.
2007-06-08 23:49:12 -03:00
Alexis S. L. Carvalho
274bce0c1c run-tests.py: pass -L/--label to simplemerge
This should give us conflict markers that don't change from one run
to another.

Remove some sed's/egrep's from some tests.
2007-04-28 17:55:45 -03:00
Alexis S. L. Carvalho
a4fb0722ca change tests to use simplemerge by default 2007-04-16 20:17:39 -03:00
Alexis S. L. Carvalho
31232bf5ab run-tests.py: use coverage.py with "#!/usr/bin/env python" tests 2007-04-07 04:27:55 -03:00
Alexis S. L. Carvalho
63574c7e40 run-tests.py: small cleanup 2007-04-07 04:27:55 -03:00
Alexis S. L. Carvalho
5dd065da79 run-tests.py: use coverage.py with *.py tests 2007-04-07 04:27:55 -03:00
Alexis S. L. Carvalho
77c152a933 run-tests.py: tell coverage.py to ignore errors
Otherwise there'll be some IOErrors when it tries to open python
files created during the execution of e.g. test-hook.
2007-04-07 04:27:55 -03:00
Matt Mackall
ab12bf1889 tests: set a default encoding for running tests (ASCII) 2006-12-03 16:16:33 -06:00
Matt Mackall
6b93d4c0fd tests: add -i switch
Prompt to accept changes for tests where output changed
2006-11-08 13:20:08 -06:00
Matt Mackall
4dc56ee619 tests: add -R switch
Restarts at first .err file if one exists, otherwise runs all tests
2006-11-08 13:20:08 -06:00
Matt Mackall
a6ea08deb0 tests: sort test list if running all tests 2006-11-08 13:20:08 -06:00
Matt Mackall
6feb12faa2 run-tests: add --first switch to exit on first error 2006-10-09 23:08:41 -05:00
Matt Mackall
a11adc1f86 run-tests: add --retest switch
-r reruns tests for which a .err file exists
2006-10-09 23:05:11 -05:00
Thomas Arendsen Hein
0a7b982aa6 Whitespace/Tab cleanup 2006-10-01 19:26:33 +02:00
Thomas Arendsen Hein
31b1fbbac8 Clear contents of global hgrc for tests before running each test.
This fixes running test-mq-qdiff after test-mq, because of changed settings.
2006-08-22 09:55:14 +02:00
Vadim Gelfer
ee86bed69f run-tests.py: skip tests that should not run.
print message when any test is skipped.
count skipped tests.
2006-07-27 15:53:08 -07:00
Vadim Gelfer
be51fbc3c0 merge with crew. 2006-07-27 12:36:17 -07:00
Will Maier
d6dfcfff0a Provide a relevant description for --timeout. 2006-07-25 10:29:43 -05:00
Alexis S. L. Carvalho
4fdf56c807 run-tests.py: fix diff output when test-foo.out doesn't exist.
Previously, if test-foo.out doesn't exist and test-foo outputs
something, the first line of the diff will look like this:

-+changeset:   0:0acdaf898367

(note the leading "-")
2006-07-21 01:51:17 -03:00
Alexis S. L. Carvalho
874e690312 Allow tests that end in .py and .bat
Revision f2f17143efd1 disallowed tests that have a '.' in the name, but
that also disallows tests that end in .py and .bat, even though run-tests.py
has some code to special case them.
2006-07-21 01:51:17 -03:00
Lee Cantey
9582336ca9 Add merge to list of required tools. 2006-07-13 09:50:51 -07:00