Commit Graph

60 Commits

Author SHA1 Message Date
Matt Mackall
241d2dc08e tests: change some #ifs to #requires 2014-08-06 11:53:08 -05:00
Matt Mackall
90abbd742c test-check-code-hg: use locate instead of manifest 2014-05-05 13:42:08 -05:00
Matt Mackall
066106a597 test-check-code-hg: drop manual check of non-.py scripts 2014-05-05 13:41:29 -05:00
Matt Mackall
e8b8876b1e test-check-code-hg: use test-repo check 2014-05-05 13:42:58 -05:00
Simon Heimberg
8a4db51de9 check-code: always report when a file is skipped by "no-check-code"
Skipping an entire file generally from checking is an important event, so
report it always.
Do not tell the check name because skipping does not depend on it. Directly
skip the entire file instead of checking more patterns and skip again.

The pragma no-check-code was introduced by accident in the past. (Fixed in
bc3ff9741549 and aa06d5c0d698.) This now is prevented because the files
to skip have to be listed in the test output of test-check-code-hg.t.
2014-01-07 22:29:15 +01:00
Simon Heimberg
c498cc8a17 tests: test-check-code-hg.t works for all files to check
with xargs, backslashes are eaten up. Convert them to slashes therefore.
This is only a problem with ls (on windows). hg manifest returns slashes.

The pipe char is moved before the line end for telling check-code.py that sed
does not modify the output.
2013-07-22 10:04:53 +02:00
Simon Heimberg
e09204c2b3 tests: print line numbers when checking code
When an exception will be listed the line numbers can be replaced with glob
as it is done in test-check-pyflakes.t
2013-07-06 21:48:07 +02:00
Simon Heimberg
8e20317c84 tests: rename files to py extension instead of copying a 2nd time 2013-07-06 21:48:01 +02:00
Simon Heimberg
6444a88e7c tests: check-code all python files in one run 2013-07-06 21:47:56 +02:00
simon@laptop-tosh
ce4ccac760 tests: check-code more python files without py extension
files found by running
  $ hg manifest | grep -v "\." | xargs file | grep python
2013-06-13 01:44:02 +02:00
Mads Kiilerich
a64108eee3 tests: run check-code on Python files without .py extension 2013-04-17 03:39:36 +02:00
Kevin Bullock
5353c124c3 tests: remove last two check-code warnings about killdaemons
Removes the last of the warnings in test-check-code-hg.t introduced in
fcbcb17ae5ed.
2013-02-09 13:58:13 +00:00
Kevin Bullock
e1f1e38c39 tests: guard against obsolete markers in the hg repo itself
If obsolete markers appear in the hg repo (because of enabling evolve),
then tests that run hg against the hg repo itself will see warnings like:

  obsolete feature not enabled but 4 markers found!

As far as I can tell, this only occurs in test-check-code-hg.t -- in
particular, it will -not- show up on tests that run against test-created
repos, as most of the test suite does.
2013-02-09 13:35:45 +00:00
Augie Fackler
b2f57ecfe9 test-obsolete.t: migrate to killdaemons from kill cat pidfile 2013-02-09 05:37:36 -06:00
Augie Fackler
74aee9b680 test-inotify.t: migrate to killdaemons from kill cat pidfile 2013-02-09 05:36:19 -06:00
Augie Fackler
bddb04dfb4 test-inotify-lookup.t: migrate to killdaemons from kill cat pidfile 2013-02-09 05:35:20 -06:00
Augie Fackler
ff3429d228 test-inotify-issue1556.t: migrate to killdaemons from kill cat pidfile 2013-02-09 05:34:22 -06:00
Augie Fackler
63cc9c8e29 test-inotify-issue1542.t: migrate to killdaemons from kill cat pidfile 2013-02-09 05:33:39 -06:00
Augie Fackler
5030070b2b test-inotify-issue1371.t: switch to killdaemons from kill cat pidfile 2013-02-09 05:32:00 -06:00
Augie Fackler
6ca6df22df test-inotify-debuginotify.t: migrate to killdaemons from kill cat pidfile 2013-02-09 05:30:40 -06:00
Augie Fackler
99be2eecf2 test-hgweb-raw.t: use killdaemons instead of kill cat pidfile 2013-02-09 05:29:10 -06:00
Augie Fackler
35b5aef714 test-https.t: stop using kill cat $pidfile 2013-02-09 05:26:16 -06:00
Kevin Bullock
7974778403 check-code: fix platform-specific error code variance
test-check-code-hg.t uses xargs to invoke check-code.py on every file in
'hg manifest'. The return code from xargs varies between BSD xargs and
GNU xargs: BSD will return 1 if any invocation exits with an error code;
GNU xargs will return 123 in this case. This normalizes the exit code
back to 1.
2013-02-08 22:42:07 +00:00
Kevin Bullock
72b1fbb751 check-code: warn to use killdaemons instead of kill cat PIDFILE
We have a bunch of tests that still use

    kill `cat hg.pid`

or worse,

    kill `cat hg.pid`; while kill -0 `cat hg.pid`; sleep 0; done

Cleaning these up to use tests/killdaemons.py is non-trivial, so for now
we just add a warning.
2013-02-08 19:32:56 +00:00
Matt Mackall
202783c374 tests: only call check-code once
The accepted warnings list is now empty, let's try to keep it that way.
2012-11-26 15:59:02 -06:00
Matt Mackall
fd58e8703f i18n: wrap false positives for translation detection 2012-11-25 13:53:47 -06:00
FUJIWARA Katsunori
536e35fc32 i18n: make column positioning message of MQ summary output translatable
Before this patch, one of column positioning messages of MQ summary
output is not translatable, and patches are always listed up at fixed
column position like below, when patch queue is not empty:

    mq:     1 applied, 1 unapplied

But column positioning messages for other summarized information are
translatable, so other information may be displayed at different
column position on non-English locale environments.

This patch makes column positioning message of MQ summary output
translatable.
2012-10-31 03:59:28 +09:00
Idan Kamara
4922480923 check-code: replace heredocs in unified tests
Heredocs are usually fed to other commands and
shouldn't follow the standard conventions of shell
commands.

This restores the old behaviour of how heredocs
were handled in old-style test files.
2012-10-03 22:09:18 +02:00
Patrick Mezard
ed389c0023 wireproto: fix check-code.py breakage introduced by 6e0f31b6f59a 2012-09-15 08:38:02 +02:00
Bryan O'Sullivan
10380b320f wireproto: don't format a debug string inside a hot loop
This improves stream_out performance by about 5%.
2012-09-14 12:06:40 -07:00
Bryan O'Sullivan
55e3685d62 wireproto: bypass filechunkiter for small files when streaming
Merely creating and using a generator has a measurable impact,
particularly since the common case for stream_out is generators that
yield just once. Avoiding generators improves stream_out performance
by about 7%.
2012-09-14 12:05:37 -07:00
Christian Ebert
7b42c28269 keyword: intentionally ignore check-code warning about unwrapped ui message 2012-05-13 14:26:26 +01:00
Brodie Rao
7f47d4e347 check-code: ignore naked excepts with a "re-raise" comment
This also promotes the naked except check from a warning to an error.
2012-05-13 13:18:06 +02:00
Brodie Rao
a706d64a2c cleanup: replace naked excepts with except Exception: ... 2012-05-12 16:02:46 +02:00
Brodie Rao
c577fac135 cleanup: replace naked excepts with more specific ones 2012-05-12 16:02:45 +02:00
Brodie Rao
d6a6abf2b0 cleanup: eradicate long lines 2012-05-12 15:54:54 +02:00
Matt Mackall
4d12f82b66 merge with stable 2012-05-12 13:20:26 +02:00
Patrick Mezard
22eeeffed3 mq: add --no-backup for qpush/qpop/qgoto 2012-05-11 16:57:26 +02:00
Patrick Mezard
742f6b3850 pure/base85: align exception type/msg on base85.c
brendan mentioned on IRC that b64decode raises a TypeError too, but while the
previous exception type may be better in general, it is much easier to make it
behave like the related C code and changes nothing for mercurial itself.
2012-05-07 21:49:45 +02:00
Yuya Nishihara
8284425c7d commands: parse ui.strict config item as bool 2012-05-06 23:58:04 +09:00
Mads Kiilerich
f4efda66d8 tests: run most check-code sh checks on continued lines too
Some false errors are degraded to warnings and whitelisted.
2012-04-25 01:35:39 +02:00
Mads Kiilerich
e5bed4bfb4 tests: solaris sh can not negate exit status with '!' 2012-04-23 01:39:26 +02:00
Greg Ward
66a1ddf402 shrink-revlog: make check-code happier
There's still a naked 'except:' clause, but I'm not sure how to fix it
(what exception is it expecting?). This just fixes line length.
2012-03-28 15:25:20 -04:00
Na'Tosha Bard
c51d8441de largefiles: fix check-code errors. 2012-03-09 17:11:07 +01:00
Matt Mackall
7f2d6a6af7 merge with stable 2012-03-08 15:59:33 -06:00
Matt Mackall
f2a652218a i18n: fix all remaining uses of % inside _() 2012-03-08 13:35:27 -06:00
Matt Mackall
38ab0032cb merge with stable 2012-02-28 21:17:53 -06:00
Matt Mackall
ee77ef5137 merge with stable 2012-02-24 16:16:48 -06:00
Patrick Mezard
811b39a49c test-check-code-hg: fix xargs exit status on OSX
When xargs subcommand invocation fails in a normal way, GNU xargs returns 123
and BSD one returns 1.
2012-02-23 17:46:57 +01:00
Greg Ward
aa7b4298e2 test-check-code-hg: skip test if not in a working dir (issue3248). 2012-02-18 16:30:17 -05:00