Patchwork [5,of,5] py3: quote several instances of $PYTHON for Windows

login
register
mail settings
Submitter Matt Harbison
Date Dec. 12, 2018, 4:19 a.m.
Message ID <op.ztv6a7na9lwrgf@envy>
Download mbox | patch
Permalink /patch/37117/
State New
Headers show

Comments

Matt Harbison - Dec. 12, 2018, 4:19 a.m.
On Mon, 10 Dec 2018 06:49:11 -0500, Yuya Nishihara <yuya@tcha.org> wrote:

> On Sun, 09 Dec 2018 22:44:37 -0500, Matt Harbison wrote:
>> # HG changeset patch
>> # User Matt Harbison <matt_harbison@yahoo.com>
>> # Date 1544408614 18000
>> #      Sun Dec 09 21:23:34 2018 -0500
>> # Node ID 4b007df3bff23f32439e299d13ce1a808b857c4d
>> # Parent  e5b7d60068537baa1ffeeca4e1a81f7498d0d48e
>> py3: quote several instances of $PYTHON for Windows
>
> Queued, thanks.

Any idea how to handle test-hghave.t?  Here are 3 failed attempts:

$ hg diff

ERROR: test-hghave.t output changed
!
Failed test-hghave.t: output changed
# Ran 1 tests, 0 skipped, 1 failed.
python hash seed: 2437087002
Yuya Nishihara - Dec. 12, 2018, 11:51 a.m.
On Tue, 11 Dec 2018 23:19:45 -0500, Matt Harbison wrote:
> On Mon, 10 Dec 2018 06:49:11 -0500, Yuya Nishihara <yuya@tcha.org> wrote:
> 
> > On Sun, 09 Dec 2018 22:44:37 -0500, Matt Harbison wrote:
> >> # HG changeset patch
> >> # User Matt Harbison <matt_harbison@yahoo.com>
> >> # Date 1544408614 18000
> >> #      Sun Dec 09 21:23:34 2018 -0500
> >> # Node ID 4b007df3bff23f32439e299d13ce1a808b857c4d
> >> # Parent  e5b7d60068537baa1ffeeca4e1a81f7498d0d48e
> >> py3: quote several instances of $PYTHON for Windows
> >
> > Queued, thanks.
> 
> Any idea how to handle test-hghave.t?  Here are 3 failed attempts:
> 
> $ hg diff
> diff -r 008f3491dc53 tests/test-hghave.t
> --- a/tests/test-hghave.t       Mon Dec 10 20:01:07 2018 +0000
> +++ b/tests/test-hghave.t       Tue Dec 11 23:12:11 2018 -0500
> @@ -20,12 +20,16 @@
>     >   $ echo foo
>     >   foo
>     > EOF
> -  $ ( \
> -  > testrepohgenv; \
> -  > "$PYTHON" $TESTDIR/run-tests.py -j 1 \
> -  >    $HGTEST_RUN_TESTS_PURE test-hghaveaddon.t \
> -  > )

No idea why this doesn't work.

> +  $ cat > addontest.sh <<EOF
> +  > #!/bin/sh
> +  >
> +  > . "$TESTDIR/helpers-testrepo.sh"
> +  > testrepohgenv;
> +  > '"$PYTHON"' "$TESTDIR/run-tests.py" -j 1 \
> +  >    $HGTEST_RUN_TESTS_PURE test-hghaveaddon.t
> +  > EOF

Use <<'EOF' to not expand variables while writing to addontest.sh.

Patch

diff -r 008f3491dc53 tests/test-hghave.t
--- a/tests/test-hghave.t       Mon Dec 10 20:01:07 2018 +0000
+++ b/tests/test-hghave.t       Tue Dec 11 23:12:11 2018 -0500
@@ -20,12 +20,16 @@ 
    >   $ echo foo
    >   foo
    > EOF
-  $ ( \
-  > testrepohgenv; \
-  > "$PYTHON" $TESTDIR/run-tests.py -j 1 \
-  >    $HGTEST_RUN_TESTS_PURE test-hghaveaddon.t \
-  > )
-  running 1 tests using 1 parallel processes
+
+  $ cat > addontest.sh <<EOF
+  > #!/bin/sh
+  >
+  > . "$TESTDIR/helpers-testrepo.sh"
+  > testrepohgenv;
+  > '"$PYTHON"' "$TESTDIR/run-tests.py" -j 1 \
+  >    $HGTEST_RUN_TESTS_PURE test-hghaveaddon.t
+  > EOF
+  $ sh addontest.sh
    .
    # Ran 1 tests, 0 skipped, 0 failed.

$  py -3 run-tests.py --local test-hghave.t
running 1 tests using 1 parallel processes

--- c:/Users/Matt/hg/tests/test-hghave.t
+++ c:/Users/Matt/hg/tests/test-hghave.t.err
@@ -30,8 +30,8 @@ 
    >    $HGTEST_RUN_TESTS_PURE test-hghaveaddon.t
    > EOF
    $ sh addontest.sh
-  .
-  # Ran 1 tests, 0 skipped, 0 failed.
+  addontest.sh: line 5: "C:/Program Files/Python37/python.exe": $ENOENT$
+  [127]

  (invocation via command line)


ERROR: test-hghave.t output changed
!
Failed test-hghave.t: output changed
# Ran 1 tests, 0 skipped, 1 failed.
python hash seed: 3453714405


==============================================================

$ hg diff
diff -r 008f3491dc53 tests/test-hghave.t
--- a/tests/test-hghave.t       Mon Dec 10 20:01:07 2018 +0000
+++ b/tests/test-hghave.t       Tue Dec 11 23:13:22 2018 -0500
@@ -20,12 +20,16 @@ 
    >   $ echo foo
    >   foo
    > EOF
-  $ ( \
-  > testrepohgenv; \
-  > "$PYTHON" $TESTDIR/run-tests.py -j 1 \
-  >    $HGTEST_RUN_TESTS_PURE test-hghaveaddon.t \
-  > )
-  running 1 tests using 1 parallel processes
+
+  $ cat > addontest.sh <<EOF
+  > #!/bin/sh
+  >
+  > . "$TESTDIR/helpers-testrepo.sh"
+  > testrepohgenv;
+  > "$PYTHON" "$TESTDIR/run-tests.py" -j 1 \
+  >    $HGTEST_RUN_TESTS_PURE test-hghaveaddon.t
+  > EOF
+  $ sh addontest.sh
    .
    # Ran 1 tests, 0 skipped, 0 failed.

$  py -3 run-tests.py --local test-hghave.t
running 1 tests using 1 parallel processes

--- c:/Users/Matt/hg/tests/test-hghave.t
+++ c:/Users/Matt/hg/tests/test-hghave.t.err
@@ -30,8 +30,9 @@ 
    >    $HGTEST_RUN_TESTS_PURE test-hghaveaddon.t
    > EOF
    $ sh addontest.sh
-  .
-  # Ran 1 tests, 0 skipped, 0 failed.
+  'c:\\Program' is not recognized as an internal or external command,\r  
(esc)
+  operable program or batch file.\r (esc)
+  [1]

  (invocation via command line)


ERROR: test-hghave.t output changed
!
Failed test-hghave.t: output changed
# Ran 1 tests, 0 skipped, 1 failed.
python hash seed: 300496195

===============================================================

$ hg diff
diff -r 008f3491dc53 tests/test-hghave.t
--- a/tests/test-hghave.t       Mon Dec 10 20:01:07 2018 +0000
+++ b/tests/test-hghave.t       Tue Dec 11 23:14:19 2018 -0500
@@ -20,12 +20,16 @@ 
    >   $ echo foo
    >   foo
    > EOF
-  $ ( \
-  > testrepohgenv; \
-  > "$PYTHON" $TESTDIR/run-tests.py -j 1 \
-  >    $HGTEST_RUN_TESTS_PURE test-hghaveaddon.t \
-  > )
-  running 1 tests using 1 parallel processes
+
+  $ cat > addontest.sh <<EOF
+  > #!/bin/sh
+  >
+  > . "$TESTDIR/helpers-testrepo.sh"
+  > testrepohgenv;
+  > \"$PYTHON\" "$TESTDIR/run-tests.py" -j 1 \
+  >    $HGTEST_RUN_TESTS_PURE test-hghaveaddon.t
+  > EOF
+  $ sh addontest.sh
    .
    # Ran 1 tests, 0 skipped, 0 failed.

$  py -3 run-tests.py --local test-hghave.t
running 1 tests using 1 parallel processes

--- c:/Users/Matt/hg/tests/test-hghave.t
+++ c:/Users/Matt/hg/tests/test-hghave.t.err
@@ -30,8 +30,8 @@ 
    >    $HGTEST_RUN_TESTS_PURE test-hghaveaddon.t
    > EOF
    $ sh addontest.sh
-  .
-  # Ran 1 tests, 0 skipped, 0 failed.
+  addontest.sh: line 5: "C:/Program: $ENOENT$
+  [127]

  (invocation via command line)