[llvm] af8aee7 - [AIX] Split lit test shtest-format into two separate tests and add AIX as UNSUPPORTED for shtest-format-argv0

David Tenty via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 18 13:58:15 PDT 2020


Author: Shuhong Liu
Date: 2020-06-18T16:58:07-04:00
New Revision: af8aee7c073b37d9718903f5947dd4eff071083a

URL: https://github.com/llvm/llvm-project/commit/af8aee7c073b37d9718903f5947dd4eff071083a
DIFF: https://github.com/llvm/llvm-project/commit/af8aee7c073b37d9718903f5947dd4eff071083a.diff

LOG: [AIX] Split lit test shtest-format into two separate tests and add AIX as UNSUPPORTED for shtest-format-argv0

Summary: lit test `shtest-format.py` fails on AIX  because one of the subtest of shtest-format requires the tool `[` to be installed under the system PATH. For AIX, `[` is only available as a shell builtin and does not present as an executable file under PATH. Hence, split the original shtest-format into two separate test files and added AIX as UNSUPPORTED for the test using `[` .

Reviewers: daltenty, hubert.reinterpretcast

Reviewed By: hubert.reinterpretcast

Subscribers: delcypher, llvm-commits

Tags: #llvm

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

Added: 
    llvm/utils/lit/tests/Inputs/shtest-format-argv0/argv0.txt
    llvm/utils/lit/tests/Inputs/shtest-format-argv0/lit.cfg
    llvm/utils/lit/tests/shtest-format-argv0.py

Modified: 
    llvm/utils/lit/tests/lit.cfg
    llvm/utils/lit/tests/shtest-format.py

Removed: 
    llvm/utils/lit/tests/Inputs/shtest-format/argv0.txt


################################################################################
diff  --git a/llvm/utils/lit/tests/Inputs/shtest-format/argv0.txt b/llvm/utils/lit/tests/Inputs/shtest-format-argv0/argv0.txt
similarity index 100%
rename from llvm/utils/lit/tests/Inputs/shtest-format/argv0.txt
rename to llvm/utils/lit/tests/Inputs/shtest-format-argv0/argv0.txt

diff  --git a/llvm/utils/lit/tests/Inputs/shtest-format-argv0/lit.cfg b/llvm/utils/lit/tests/Inputs/shtest-format-argv0/lit.cfg
new file mode 100644
index 000000000000..a5ee22c731d7
--- /dev/null
+++ b/llvm/utils/lit/tests/Inputs/shtest-format-argv0/lit.cfg
@@ -0,0 +1,7 @@
+import lit.formats
+config.name = 'shtest-format-argv0'
+config.suffixes = ['.txt']
+config.test_format = lit.formats.ShTest()
+config.test_source_root = None
+config.test_exec_root = None
+config.target_triple = 'x86_64-unknown-unknown'

diff  --git a/llvm/utils/lit/tests/lit.cfg b/llvm/utils/lit/tests/lit.cfg
index f5686873ec89..85bdbf180b13 100644
--- a/llvm/utils/lit/tests/lit.cfg
+++ b/llvm/utils/lit/tests/lit.cfg
@@ -86,6 +86,8 @@ else:
 if not llvm_config:
   if sys.platform.startswith('win') or sys.platform.startswith('cygwin'):
     config.available_features.add('system-windows')
+  if platform.system() == 'AIX':
+    config.available_features.add('aix')
 
 # For each of lit's internal shell commands ('env', 'cd', '
diff ', etc.), put
 # a fake command that always fails at the start of PATH.  This helps us check

diff  --git a/llvm/utils/lit/tests/shtest-format-argv0.py b/llvm/utils/lit/tests/shtest-format-argv0.py
new file mode 100644
index 000000000000..063fa80a678a
--- /dev/null
+++ b/llvm/utils/lit/tests/shtest-format-argv0.py
@@ -0,0 +1,13 @@
+# Check that we route argv[0] as it was written, instead of the resolved
+# path. This is important for some tools, in particular '[' which at least on OS
+# X only recognizes that it is in '['-mode when its argv[0] is exactly
+# '['. Otherwise it will refuse to accept the trailing closing bracket.
+#
+# This test is not supported on AIX since `[` is only available as a shell builtin
+# and is not installed under PATH by default.
+# UNSUPPORTED: aix
+#
+# RUN: %{lit} -j 1 -v %{inputs}/shtest-format-argv0 | FileCheck %s
+
+# CHECK: -- Testing:
+# CHECK: PASS: shtest-format-argv0 :: argv0.txt

diff  --git a/llvm/utils/lit/tests/shtest-format.py b/llvm/utils/lit/tests/shtest-format.py
index 2714e20e05f3..86742e39ac4b 100644
--- a/llvm/utils/lit/tests/shtest-format.py
+++ b/llvm/utils/lit/tests/shtest-format.py
@@ -9,7 +9,6 @@
 
 # CHECK: -- Testing:
 
-# CHECK: PASS: shtest-format :: argv0.txt
 # CHECK: FAIL: shtest-format :: external_shell/fail.txt
 # CHECK-NEXT: *** TEST 'shtest-format :: external_shell/fail.txt' FAILED ***
 # CHECK: Command Output (stdout):
@@ -79,7 +78,7 @@
 
 # CHECK: Testing Time:
 # CHECK: Unsupported        : 4
-# CHECK: Passed             : 7
+# CHECK: Passed             : 6
 # CHECK: Expectedly Failed  : 4
 # CHECK: Unresolved         : 3
 # CHECK: Failed             : 3
@@ -88,9 +87,7 @@
 
 # XUNIT: <?xml version="1.0" encoding="UTF-8"?>
 # XUNIT-NEXT: <testsuites>
-# XUNIT-NEXT: <testsuite name="shtest-format" tests="22" failures="7" skipped="4">
-
-# XUNIT: <testcase classname="shtest-format.shtest-format" name="argv0.txt" time="{{[0-9]+\.[0-9]+}}"/>
+# XUNIT-NEXT: <testsuite name="shtest-format" tests="21" failures="7" skipped="4">
 
 # XUNIT: <testcase classname="shtest-format.external_shell" name="fail.txt" time="{{[0-9]+\.[0-9]+}}">
 # XUNIT-NEXT: <failure{{[ ]*}}>


        


More information about the llvm-commits mailing list