Skip to content

Commit 1f92e0e

Browse files
author
Sean Olszewski
committed
Lit config attempt #<number>
1 parent 8794e0c commit 1f92e0e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Tests/Functional/lit.cfg

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,18 @@
77
#
88
# See http://swift.org/LICENSE.txt for license information
99
# See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10-
10+
from pkg_resources import parse_version
1111
import os
1212
import platform
1313
import tempfile
1414
import sys
1515
import lit
1616
import pipes
17+
import re
1718

1819
# Set up lit config.
1920
config.name = 'SwiftXCTestFunctionalTests'
21+
config.os_info = (platform.system(), platform.mac_ver()[0])
2022
config.test_format = lit.formats.ShTest(execute_external=False)
2123
config.suffixes = ['.swift']
2224

@@ -140,7 +142,9 @@ config.substitutions.append(('%{xctest_checker}', '%%{python} %s' % xctest_check
140142
# Add Python to run xctest_checker.py tests as part of XCTest tests
141143
config.substitutions.append( ('%{python}', pipes.quote(sys.executable)) )
142144

143-
(run_cpu, run_vendor, run_os, run_vers) = re.match('([^-]+)-([^-]+)-([^0-9]+)(.*)', config.variant_triple).groups()
144-
145-
if run_os != 'macosx' or run_vers >= 12:
145+
# Conditionally report the Swift 5.5 Concurrency runtime as available depending on the OS and version.
146+
(run_os, run_vers) = config.os_info
147+
os_is_not_macOS = run_os != 'Darwin'
148+
macOS_version_is_recent_enough = parse_version(run_vers) >= parse_version('12.0')
149+
if os_is_not_macOS or macOS_version_is_recent_enough:
146150
config.available_features.add('concurrency_runtime')

0 commit comments

Comments
 (0)