summaryrefslogtreecommitdiffstats
path: root/llvm/utils/lit/tests
diff options
context:
space:
mode:
authorStella Stamenova <stilis@microsoft.com>2018-08-07 20:54:38 +0000
committerStella Stamenova <stilis@microsoft.com>2018-08-07 20:54:38 +0000
commit8efc95ac2f4be2d7a2b671e734288d6f9dfb8c5c (patch)
treea6c1b757b029fff96851540b31ef99755b315269 /llvm/utils/lit/tests
parent65bd2f6c85f64ca46c193bcf55925538356a79a8 (diff)
downloadbcm5719-llvm-8efc95ac2f4be2d7a2b671e734288d6f9dfb8c5c.tar.gz
bcm5719-llvm-8efc95ac2f4be2d7a2b671e734288d6f9dfb8c5c.zip
[lit, python3] Update lit error logging to work correctly in python3 and other test fixes
Summary: In Python2 'unicode' is a distinct type from 'str', but in Python3 'unicode' does not exist and instead all 'str' objects are Unicode string. This change updates the logic in the test logging for lit to correctly process each of the types, and more importantly, to not just fail in Python3. This change also reverses the use of quotes in several of the cfg files. By using '""' we are guaranteeing that the resulting path will work correctly on Windows while "''" only works correctly sometimes. This also fixes one of the failing tests. Reviewers: asmith, zturner Subscribers: stella.stamenova, delcypher, llvm-commits Differential Revision: https://reviews.llvm.org/D50397 llvm-svn: 339179
Diffstat (limited to 'llvm/utils/lit/tests')
-rw-r--r--llvm/utils/lit/tests/Inputs/shtest-env/lit.cfg2
-rw-r--r--llvm/utils/lit/tests/Inputs/shtest-shell/lit.cfg2
-rw-r--r--llvm/utils/lit/tests/Inputs/shtest-timeout/lit.cfg2
-rw-r--r--llvm/utils/lit/tests/lit.cfg2
-rw-r--r--llvm/utils/lit/tests/shtest-timeout.py3
5 files changed, 4 insertions, 7 deletions
diff --git a/llvm/utils/lit/tests/Inputs/shtest-env/lit.cfg b/llvm/utils/lit/tests/Inputs/shtest-env/lit.cfg
index 1b4715e79ac..1e2d050754a 100644
--- a/llvm/utils/lit/tests/Inputs/shtest-env/lit.cfg
+++ b/llvm/utils/lit/tests/Inputs/shtest-env/lit.cfg
@@ -6,4 +6,4 @@ config.test_source_root = None
config.test_exec_root = None
config.environment['FOO'] = '1'
config.environment['BAR'] = '2'
-config.substitutions.append(('%{python}', "'%s'" % (sys.executable)))
+config.substitutions.append(('%{python}', '"%s"' % (sys.executable)))
diff --git a/llvm/utils/lit/tests/Inputs/shtest-shell/lit.cfg b/llvm/utils/lit/tests/Inputs/shtest-shell/lit.cfg
index 14767f28463..3231dedc714 100644
--- a/llvm/utils/lit/tests/Inputs/shtest-shell/lit.cfg
+++ b/llvm/utils/lit/tests/Inputs/shtest-shell/lit.cfg
@@ -4,4 +4,4 @@ config.suffixes = ['.txt']
config.test_format = lit.formats.ShTest()
config.test_source_root = None
config.test_exec_root = None
-config.substitutions.append(('%{python}', "'%s'" % (sys.executable)))
+config.substitutions.append(('%{python}', '"%s"' % (sys.executable)))
diff --git a/llvm/utils/lit/tests/Inputs/shtest-timeout/lit.cfg b/llvm/utils/lit/tests/Inputs/shtest-timeout/lit.cfg
index 74f6771b923..96bf18170a8 100644
--- a/llvm/utils/lit/tests/Inputs/shtest-timeout/lit.cfg
+++ b/llvm/utils/lit/tests/Inputs/shtest-timeout/lit.cfg
@@ -29,4 +29,4 @@ config.test_exec_root = config.test_source_root
config.target_triple = '(unused)'
src_root = os.path.join(config.test_source_root, '..')
config.environment['PYTHONPATH'] = src_root
-config.substitutions.append(('%{python}', "'%s'" % (sys.executable)))
+config.substitutions.append(('%{python}', '"%s"' % (sys.executable)))
diff --git a/llvm/utils/lit/tests/lit.cfg b/llvm/utils/lit/tests/lit.cfg
index 75cba3f4f04..01a3431b435 100644
--- a/llvm/utils/lit/tests/lit.cfg
+++ b/llvm/utils/lit/tests/lit.cfg
@@ -40,7 +40,7 @@ config.substitutions.append(('%{inputs}', os.path.join(
src_root, 'tests', 'Inputs')))
config.substitutions.append(('%{lit}', "%%{python} %s" % (
os.path.join(lit_path, 'lit.py'),)))
-config.substitutions.append(('%{python}', "'%s'" % (sys.executable)))
+config.substitutions.append(('%{python}', '"%s"' % (sys.executable)))
# Enable coverage.py reporting, assuming the coverage module has been installed
diff --git a/llvm/utils/lit/tests/shtest-timeout.py b/llvm/utils/lit/tests/shtest-timeout.py
index 2f1fc3d17c0..70b1dee887a 100644
--- a/llvm/utils/lit/tests/shtest-timeout.py
+++ b/llvm/utils/lit/tests/shtest-timeout.py
@@ -1,8 +1,5 @@
# REQUIRES: python-psutil
-# PR33944
-# XFAIL: windows
-
# FIXME: This test is fragile because it relies on time which can
# be affected by system performance. In particular we are currently
# assuming that `short.py` can be successfully executed within 2
OpenPOWER on IntegriCloud