Commit Graph

13 Commits

Author SHA1 Message Date
Danek Duvall
213f203c87 tests: Solaris grep doesn't add a trailing newline when it's missing
The bad-extension tests emits a list of not-loaded extensions, and pipes
that output through grep.  On Solaris, the test-output gets "(no-eol)"
appended because although the message has no trailing newline, GNU grep
adds it.  If we simply add the newline to the message, the problem goes
away for both versions of grep.
2016-03-02 15:01:41 -08:00
Jun Wu
6ee6b437f3 extensions: add notloaded method to return extensions failed to load
Before this patch, there is no easy way to detect if there are extensions
failed to load. While this is okay for most situations, chgserver is designed
to preload all extensions specified in config and does need the information.
This patch adds extensions.notloaded() to return names of extensions failed
to load.
2016-02-10 16:59:34 +00:00
Simon Farnsworth
440b97f84b tests: confirm that a badly documented extension doesn't cause a crash
An external extension whose docstring doesn't conform to Mercurial standards
used to cause crashes. Test that we omit such extensions when you do a
keyword search.
2016-02-12 06:25:05 -08:00
Bryan O'Sullivan
d17fc62ed2 test-bad-extension: account for PyPy/CPython error difference 2015-12-23 16:22:20 -08:00
timeless@mozdev.org
36e75d4956 test-bad-extension: reduce dependencies on other things
test-bad-extension would jitter if the format of the first line
of hg help changed, which isn't relevant to its goal.
2015-09-10 19:45:46 -04:00
Yuya Nishihara
8c4e6f9099 extensions: show traceback on load failure if --traceback flag is set
Before this patch, there was no handy way to investigate the reason why
extension couldn't be loaded.

If ui.debug is set, tracebacks of both "hgext.foo" and "foo" are displayed
because the first ImportError could occur at very deep dependency module.
2015-03-30 16:23:35 +09:00
Yuya Nishihara
ed7051c6c7 tests: write hgrc of more than two lines by using shell heredoc
Here document should be readable than repeating echo commands.
2014-11-04 23:41:46 +09:00
Martin Geisler
58a533fee9 help: add -c/--command flag to only show command help (issue2799) 2011-05-10 14:42:53 +02:00
Henri Wiechers
7134ed3f0f help: add -e/--extension switch to display extension help text 2010-01-20 20:24:20 +02:00
Mads Kiilerich
3174ff376b tests: remove redundant globs
Many globs now just match $TESTTMP and is no longer needed.
2010-10-08 22:36:10 -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
Martin Geisler
801decc13d tests: unify test-bad-extension 2010-08-14 02:35:44 +02:00