Patchwork [2,of,2,V2] test-run-tests.t: added test for '--json' option

login
register
mail settings
Submitter Anurag Goel
Date June 22, 2014, 1:44 p.m.
Message ID <e2b4d60a40d391e96b2e.1403444684@ubuntu.ubuntu-domain>
Download mbox | patch
Permalink /patch/5038/
State Changes Requested
Headers show

Comments

Anurag Goel - June 22, 2014, 1:44 p.m.
# HG changeset patch
# User anuraggoel <anurag.dsps@gmail.com>
# Date 1403444504 -19800
#      Sun Jun 22 19:11:44 2014 +0530
# Node ID e2b4d60a40d391e96b2e19fb5e1b24745ba5e570
# Parent  dc6a80b4ddf2d3199f055bda8f751e3ff24c95f8
test-run-tests.t: added test for '--json' option

Below patch checks the behaviour for '--json' option.
Pierre-Yves David - June 23, 2014, 9:08 a.m.
On 06/22/2014 06:44 AM, Anurag Goel wrote:
> # HG changeset patch
> # User anuraggoel <anurag.dsps@gmail.com>
> # Date 1403444504 -19800
> #      Sun Jun 22 19:11:44 2014 +0530
> # Node ID e2b4d60a40d391e96b2e19fb5e1b24745ba5e570
> # Parent  dc6a80b4ddf2d3199f055bda8f751e3ff24c95f8
> test-run-tests.t: added test for '--json' option
>
> Below patch checks the behaviour for '--json' option.

Should be in the same patch as the feature.


>
> diff -r dc6a80b4ddf2 -r e2b4d60a40d3 tests/test-run-tests.t
> --- a/tests/test-run-tests.t	Sun Jun 22 19:10:07 2014 +0530
> +++ b/tests/test-run-tests.t	Sun Jun 22 19:11:44 2014 +0530
> @@ -201,3 +201,18 @@
>     # Ran 2 tests, 0 skipped, 0 warned, 1 failed.
>     python hash seed: * (glob)
>     [1]
> +
> +test for --json
> +=================
> +
> +  $ $TESTDIR/run-tests.py --with-hg=`which hg` test-success.t --json
> +  .
> +  # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
> +
> +  $ cat report.json
> +  testreport ={
> +    "test-success.t": * (glob)

Globing is too wide.


> +  } (no-eol)
> +
> +(removing json file)
> +  $ rm report.json
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>

Patch

diff -r dc6a80b4ddf2 -r e2b4d60a40d3 tests/test-run-tests.t
--- a/tests/test-run-tests.t	Sun Jun 22 19:10:07 2014 +0530
+++ b/tests/test-run-tests.t	Sun Jun 22 19:11:44 2014 +0530
@@ -201,3 +201,18 @@ 
   # Ran 2 tests, 0 skipped, 0 warned, 1 failed.
   python hash seed: * (glob)
   [1]
+
+test for --json
+=================
+
+  $ $TESTDIR/run-tests.py --with-hg=`which hg` test-success.t --json
+  .
+  # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
+
+  $ cat report.json
+  testreport ={
+    "test-success.t": * (glob)
+  } (no-eol)
+
+(removing json file)
+  $ rm report.json