run-tests: add possibility for test-runners to report a "warned" test result
A test result is recognized as "warned" when the test runner returns the exit
code False. (False is similar to 0, which is reporting a command has run
sucessfully.)
The only difference in display is that the failure message while running writes
"Warning:" instead of "ERROR:". The diff output is the same as when the test
fails. Runing "run-tests.py -i" asks to accept the changed result also for
tests reported as "warned".
When running tests, a "warned" test would look like this:
..
--- xxxx\tests\test-something.t
+++ xxxx\tests\test-something.t.err
@@ -1279,7 +1279,7 @@
$ echo anything
$ hg commit -S -m whatever
committing subrepository s
- committing subrepository s/sbs
+ committing subrepository s/sbs (glob)
warning: something happened
committing subrepository t
$ echo something
Warning: xxxx\tests\test-sOMETHING.t output changed
~.s...s...s..
Reporting a test result as "warned" will be used in following patches.
[ original upstream message ]
#!/usr/bin/env python
# $Id$
from distutils.core import setup
import os, time
# specify version, Mercurial version otherwise
version = ''
unknown_version = 'unknown'
def getversion():
global version, unknown_version
if not version and os.path.isdir('.hg'):
p = os.popen('hg --quiet identify 2> %s' % os.devnull)
ident = p.read()[:-1]
if not p.close() and ident:
if ident[-1] != '+':
version = ident
else:
version = ident[:-1]
version += time.strftime('+%Y%m%d')
return version or unknown_version
setup(name='hgkw',
version=getversion(),
description='Mercurial keyword extension (standalone)',
author='Christian Ebert',
author_email='blacktrash@gmx.net',
url='http://www.blacktrash.org/hg/hgkeyword/',
license='GNU GPL',
packages=['hgkw'])