[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
This commit is contained in:
Shuhong Liu 2020-06-18 16:51:53 -04:00 committed by David Tenty
parent 01277bc956
commit af8aee7c07
5 changed files with 24 additions and 5 deletions

View File

@ -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'

View File

@ -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

View File

@ -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

View File

@ -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{{[ ]*}}>