[PATCH] D50206: [lit, windows] Fix several lit tests on Windows

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 2 16:25:27 PDT 2018


Should the substitution just be surrounded by quotes automatically so we
don’t have this problem?
On Thu, Aug 2, 2018 at 4:19 PM Stella Stamenova via Phabricator <
reviews at reviews.llvm.org> wrote:

> stella.stamenova created this revision.
> stella.stamenova added reviewers: asmith, zturner.
> Herald added subscribers: llvm-commits, delcypher.
>
> The issue with these tests is that they use python, but the path to python
> on Windows can contain spaces. To make the tests always work, pass the path
> surrounded by quotes.
>
>
> Repository:
>   rL LLVM
>
> https://reviews.llvm.org/D50206
>
> Files:
>   utils/lit/tests/boolean-parsing.py
>   utils/lit/tests/discovery.py
>   utils/lit/tests/lit.cfg
>   utils/lit/tests/shell-parsing.py
>   utils/lit/tests/unittest-adaptor.py
>
>
> Index: utils/lit/tests/unittest-adaptor.py
> ===================================================================
> --- utils/lit/tests/unittest-adaptor.py
> +++ utils/lit/tests/unittest-adaptor.py
> @@ -1,6 +1,6 @@
>  # Check the lit adaption to run under unittest.
>  #
> -# RUN: %{python} %s %{inputs}/unittest-adaptor 2> %t.err
> +# RUN: '%{python}' %s %{inputs}/unittest-adaptor 2> %t.err
>  # RUN: FileCheck < %t.err %s
>  #
>  # CHECK-DAG: unittest-adaptor :: test-two.txt ... FAIL
> Index: utils/lit/tests/shell-parsing.py
> ===================================================================
> --- utils/lit/tests/shell-parsing.py
> +++ utils/lit/tests/shell-parsing.py
> @@ -1,3 +1,3 @@
>  # Just run the ShUtil unit tests.
>  #
> -# RUN: %{python} -m lit.ShUtil
> +# RUN: '%{python}' -m lit.ShUtil
> Index: utils/lit/tests/lit.cfg
> ===================================================================
> --- utils/lit/tests/lit.cfg
> +++ utils/lit/tests/lit.cfg
> @@ -38,7 +38,7 @@
>  config.substitutions.append(('%{src_root}', src_root))
>  config.substitutions.append(('%{inputs}', os.path.join(
>              src_root, 'tests', 'Inputs')))
> -config.substitutions.append(('%{lit}', "%%{python} %s" % (
> +config.substitutions.append(('%{lit}', "\'%%{python}\' %s" % (
>              os.path.join(lit_path, 'lit.py'),)))
>  config.substitutions.append(('%{python}', sys.executable))
>
> Index: utils/lit/tests/discovery.py
> ===================================================================
> --- utils/lit/tests/discovery.py
> +++ utils/lit/tests/discovery.py
> @@ -26,7 +26,7 @@
>  # CHECK-BASIC-OUT: top-level-suite :: test-two
>
>  # Check discovery when providing the special builtin 'config_map'
> -# RUN: %{python} %{inputs}/config-map-discovery/driver.py \
> +# RUN: '%{python}' %{inputs}/config-map-discovery/driver.py \
>  # RUN:           %{inputs}/config-map-discovery/main-config/lit.cfg \
>  # RUN:           %{inputs}/config-map-discovery/lit.alt.cfg \
>  # RUN:           --single-process --debug --show-tests --show-suites >
> %t.out 2> %t.err
> Index: utils/lit/tests/boolean-parsing.py
> ===================================================================
> --- utils/lit/tests/boolean-parsing.py
> +++ utils/lit/tests/boolean-parsing.py
> @@ -1,4 +1,4 @@
>  # Test the boolean expression parser
>  # used for REQUIRES and UNSUPPORTED and XFAIL
>
> -# RUN: %{python} -m lit.BooleanExpression
> +# RUN: '%{python}' -m lit.BooleanExpression
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180802/ebd357b2/attachment.html>


More information about the llvm-commits mailing list