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

login
register
mail settings
Submitter timeless@mozdev.org
Date Nov. 25, 2015, 6:31 a.m.
Message ID <3959884258260babbfe1.1448433098@waste.org>
Download mbox | patch
Permalink /patch/11648/
State Changes Requested
Headers show

Comments

timeless@mozdev.org - Nov. 25, 2015, 6:31 a.m.
# HG changeset patch
# User timeless <timeless@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
Yuya Nishihara - Nov. 28, 2015, 1:41 p.m.
On Wed, 25 Nov 2015 00:31:38 -0600, timeless wrote:
> # HG changeset patch
> # User timeless <timeless@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
timeless - Nov. 29, 2015, 5:53 a.m.
On Sat, Nov 28, 2015 at 8:41 AM, Yuya Nishihara <yuya@tcha.org> wrote:
>> +    'debug': ('HGTEST_DEBUG', ''),

> needs to update the help message as well?

oh, you're right.

> This patch implements two functions, but it's unclear from the patch
> description. Are both intended?
>
>  a. allow HGTEST_DEBUG=1 ./run-tests.py

I forgot about this property.

>  b. pass "--debug" to *.t tests through $HGTEST_DEBUG

Because I forgot about (a) even though I had used it for the slow
thing, the env property change  w/o the latter didn't seem
particularly useful, but, you're right...

Patch

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),
@@ -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
   Skipping hgext/zeroconf/Zeroconf.py it has no-che?k-code (glob)
   Skipping i18n/polib.py it has no-che?k-code (glob)
   Skipping mercurial/httpclient/__init__.py it has no-che?k-code (glob)