Patchwork run-tests: handle empty tests

login
register
mail settings
Submitter timeless@mozdev.org
Date April 6, 2016, 6:31 p.m.
Message ID <8675fcfc1c00ebea1133.1459967479@waste.org>
Download mbox | patch
Permalink /patch/14398/
State Accepted
Headers show

Comments

timeless@mozdev.org - April 6, 2016, 6:31 p.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1459830380 0
#      Tue Apr 05 04:26:20 2016 +0000
# Node ID 8675fcfc1c00ebea1133fba022ee6a2ed0130cd9
# Parent  ea86cdcd9b50bf38c6b9dd7bbaa04b9c8cc0aefb
run-tests: handle empty tests
Augie Fackler - April 7, 2016, 1:08 a.m.
On Wed, Apr 06, 2016 at 01:31:19PM -0500, timeless wrote:
> # HG changeset patch
> # User timeless <timeless@mozdev.org>
> # Date 1459830380 0
> #      Tue Apr 05 04:26:20 2016 +0000
> # Node ID 8675fcfc1c00ebea1133fba022ee6a2ed0130cd9
> # Parent  ea86cdcd9b50bf38c6b9dd7bbaa04b9c8cc0aefb
> run-tests: handle empty tests

queued, thanks

>
> diff --git a/tests/run-tests.py b/tests/run-tests.py
> --- a/tests/run-tests.py
> +++ b/tests/run-tests.py
> @@ -1058,6 +1058,7 @@
>          if os.getenv('MSYSTEM'):
>              script.append(b'alias pwd="pwd -W"\n')
>
> +        n = 0
>          for n, l in enumerate(lines):
>              if not l.endswith(b'\n'):
>                  l += b'\n'
> diff --git a/tests/test-run-tests.t b/tests/test-run-tests.t
> --- a/tests/test-run-tests.t
> +++ b/tests/test-run-tests.t
> @@ -42,6 +42,15 @@
>    $ rm hg
>  #endif
>
> +an empty test
> +=======================
> +
> +  $ touch test-empty.t
> +  $ rt
> +  .
> +  # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
> +  $ rm test-empty.t
> +
>  a succesful test
>  =======================
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -1058,6 +1058,7 @@ 
         if os.getenv('MSYSTEM'):
             script.append(b'alias pwd="pwd -W"\n')
 
+        n = 0
         for n, l in enumerate(lines):
             if not l.endswith(b'\n'):
                 l += b'\n'
diff --git a/tests/test-run-tests.t b/tests/test-run-tests.t
--- a/tests/test-run-tests.t
+++ b/tests/test-run-tests.t
@@ -42,6 +42,15 @@ 
   $ rm hg
 #endif
 
+an empty test
+=======================
+
+  $ touch test-empty.t
+  $ rt
+  .
+  # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
+  $ rm test-empty.t
+
 a succesful test
 =======================