[PATCH 1 of 3] run-tests: map --debug to $HGTEST_DEBUG

Yuya Nishihara yuya at tcha.org
Sat Nov 28 07:41:49 CST 2015


On Wed, 25 Nov 2015 00:31:38 -0600, timeless wrote:
> # HG changeset patch
> # User timeless <timeless at mozdev.org>
> # Date 1448430663 0
> #      Wed Nov 25 05:51:03 2015 +0000
> # Node ID 3959884258260babbfe1adc4020665dee12b0703
> # Parent  df9b73d2d444ae82fe8d3fe6cf682a93b2c4a7ef
> run-tests: map --debug to $HGTEST_DEBUG
> 
> diff --git a/tests/run-tests.py b/tests/run-tests.py
> --- a/tests/run-tests.py
> +++ b/tests/run-tests.py
> @@ -152,6 +152,7 @@
>      IMPL_PATH = b'JYTHONPATH'
>  
>  defaults = {
> +    'debug': ('HGTEST_DEBUG', ''),
>      'jobs': ('HGTEST_JOBS', 1),
>      'timeout': ('HGTEST_TIMEOUT', 180),
>      'port': ('HGTEST_PORT', 20059),

needs to update the help message as well?

> @@ -1847,6 +1848,9 @@
>          elif 'HGTEST_SLOW' in os.environ:
>              del os.environ['HGTEST_SLOW']
>  
> +        if self.options.debug:
> +            os.environ["HGTEST_DEBUG"] = "--debug"
> +
>          self._coveragefile = os.path.join(self._testdir, b'.coverage')
>  
>          vlog("# Using TESTDIR", self._testdir)
> diff --git a/tests/test-check-code-hg.t b/tests/test-check-code-hg.t
> --- a/tests/test-check-code-hg.t
> +++ b/tests/test-check-code-hg.t
> @@ -7,7 +7,7 @@
>  (The writing "no-che?k-code" is for not skipping this file when checking.)
>  
>    $ hg locate | sed 's-\\-/-g' |
> -  >   xargs "$check_code" --warnings --per-file=0 || false
> +  >   xargs "$check_code" $HGTEST_DEBUG --warnings --per-file=0 || false

This patch implements two functions, but it's unclear from the patch
description. Are both intended?

 a. allow HGTEST_DEBUG=1 ./run-tests.py
 b. pass "--debug" to *.t tests through $HGTEST_DEBUG


More information about the Mercurial-devel mailing list