[all-commits] [llvm/llvm-project] 41d790: [libcxx] [test] Fix the _supportsVerify check on W...

Martin Storsjö via All-commits all-commits at lists.llvm.org
Mon May 31 23:53:02 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 41d7909368bebc897467a75860a524a5f172564f
      https://github.com/llvm/llvm-project/commit/41d7909368bebc897467a75860a524a5f172564f
  Author: Martin Storsjö <martin at martin.st>
  Date:   2021-06-01 (Tue, 01 Jun 2021)

  Changed paths:
    M libcxx/utils/libcxx/test/config.py
    M llvm/utils/lit/lit/TestRunner.py

  Log Message:
  -----------
  [libcxx] [test] Fix the _supportsVerify check on Windows by fixing quoting

The pipes.quote function quotes using single quotes, the same goes
for the newer shlex.quote (which is the preferred form in Python 3).
This isn't suitable for quoting in command lines on Windows (and the
documentation for shlex.quote even says it's only usable for Unix
shells).

In general, the python subprocess.list2cmdline function should do
proper quoting for the platform's current shell. However, it doesn't
quote the ';' char, which we pass within some arguments to run.py.
Therefore use the custom reimplementation from lit.TestRunner which
is amended to quote ';' too.

The fact that arguemnts were quoted with single quotes didn't matter
for command lines that were executed by either bash or the lit internal
shell, but if executing things directly using subprocess.call, as in
_supportsVerify, the quoted path to %{cxx} fails to be resolved by the
Windows shell.

This unlocks 114 tests that previously were skipped on Windows.

Differential Revision: https://reviews.llvm.org/D103310




More information about the All-commits mailing list