llvm-project/llvm/utils/lit/tests/Inputs
Michal Gorny 0c28a8f628 [lit] Fix UnicodeEncodeError when test commands contain non-ASCII chars
Ensure that the bash script written by lit TestRunner is open with UTF-8
encoding when using Python 3.  Otherwise, attempt to write non-ASCII
characters causes UnicodeEncodeError.  This happened e.g. with
the following LLD test:

UNRESOLVED: lld :: ELF/format-binary-non-ascii.s (657 of 2119)
******************** TEST 'lld :: ELF/format-binary-non-ascii.s' FAILED ********************
Exception during script execution:
Traceback (most recent call last):
  File "/home/mgorny/llvm-project/llvm/utils/lit/lit/worker.py", line 63, in _execute_test
    result = test.config.test_format.execute(test, lit_config)
  File "/home/mgorny/llvm-project/llvm/utils/lit/lit/formats/shtest.py", line 25, in execute
    self.execute_external)
  File "/home/mgorny/llvm-project/llvm/utils/lit/lit/TestRunner.py", line 1644, in executeShTest
    res = _runShTest(test, litConfig, useExternalSh, script, tmpBase)
  File "/home/mgorny/llvm-project/llvm/utils/lit/lit/TestRunner.py", line 1590, in _runShTest
    res = executeScript(test, litConfig, tmpBase, script, execdir)
  File "/home/mgorny/llvm-project/llvm/utils/lit/lit/TestRunner.py", line 1157, in executeScript
    f.write('{ ' + '; } &&\n{ '.join(commands) + '; }')
UnicodeEncodeError: 'ascii' codec can't encode character '\xa3' in position 274: ordinal not in range(128)

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

llvm-svn: 363388
2019-06-14 13:31:48 +00:00
..
config-map-discovery
discovery
exec-discovery
exec-discovery-in-tree
googletest-format
googletest-timeout
googletest-upstream-format
max-failures
parallelism-groups [lit] Allow setting parallelism groups to None 2019-02-26 19:03:26 +00:00
progress-bar [lit][NFC] Cleanup copy&paste naming mistake 2019-02-15 02:44:52 +00:00
py-config-discovery
shtest-env Python compat - print statement 2019-01-03 14:11:33 +00:00
shtest-format [lit] Fix UnicodeEncodeError when test commands contain non-ASCII chars 2019-06-14 13:31:48 +00:00
shtest-output-printing [lit][tests][AIX] Update expected form of diagnostic messages; use `not` to normalize non-zero exit values 2019-05-01 15:47:16 +00:00
shtest-run-at-line [lit] Report line number for failed RUN command 2018-05-31 00:55:32 +00:00
shtest-shell Add Support for Creating and Deleting Unicode Files and Directories in Lit 2019-02-28 19:16:17 +00:00
shtest-timeout [lit] Respect PYTHONPATH 2019-01-07 16:24:37 +00:00
test-data [LIT] Move xunit tests tests into their own location, and and add failures 2018-05-10 22:51:28 +00:00
test-data-micro [lit] - Allow 1 test to report multiple micro-test results to provide support for microbenchmarks. 2018-03-13 16:37:59 +00:00
testrunner-custom-parsers make XFAIL, REQUIRES, and UNSUPPORTED support multi-line expressions 2019-01-20 00:51:02 +00:00
xunit-output Escape ]]> in xunit xml output 2018-05-16 09:00:28 +00:00