Skip to content

Commit 267a910

Browse files
author
Tiago Martinho
committed
[SR-1047] Run xctest_checker tests in tests
swift-corelibs-xctest uses a Python program called xctest_checker to run its functional test suite. That program itself has unit tests, written in Python. These unit tests should be run as part of the greater XCTest test suite. This is probably possible by modifying the lit.cfg in the swift-corelibs-xctest project such that it picks up on a file with a RUN: directive that triggers the Python tests. See swiftlang/swift#778 for an example. See llvm.org/docs/CommandGuide/lit.html for additional details on lit--it's the test runner for Swift, LLVM, and other projects, so it's nice to know about it.
1 parent 7d03cdb commit 267a910

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Tests/Functional/lit.cfg

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import os
1212
import platform
1313
import tempfile
14-
14+
import sys
1515
import lit
1616

1717
# Set up lit config.
@@ -105,3 +105,6 @@ xctest_checker = os.path.join(
105105
'xctest_checker',
106106
'xctest_checker.py')
107107
config.substitutions.append(('%{xctest_checker}', xctest_checker))
108+
109+
# Add Python to run xctest_checker.py tests as part of XCTest tests
110+
config.substitutions.append( ('%{python}', sys.executable) )
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// RUN: %{python} -m unittest discover

0 commit comments

Comments
 (0)