Description
Previous ID | SR-1944 |
Radar | None |
Original Reporter | @modocache |
Type | Improvement |
Additional Detail from JIRA
Votes | 0 |
Component/s | XCTest |
Labels | Improvement |
Assignee | None |
Priority | Medium |
md5: 961cab0c1de40e4880f026d33ac12047
Issue Description:
xctest-checker was originally added in #20 as a replacement for FileCheck. At that time, it was easy to build swift-corelibs-xctest without first building apple/swift from source. As we continued to develop xctest-checker into a more fully-featured FileCheck replacement, @briancroom wondered whether it would make sense to switch to FileCheck completely: #94 (comment) I argued against this because it would mean completely coupling the corelibs-xctest build to the overall apple/swift build.
However, as its dependencies on other projects such as swift-corelibs-foundation have expanded, swift-corelibs-xctest has been encouraging contributors to use the Swift build script to build and test the project for a long while now:
apple/swift-corelibs-xctest $ ../swift/utils/build-script --preset corelibs-xctest
The Swift build script has access to the LLVM bin directory, and as such it knows where to find FileCheck.
Is it time to replace xctest-checker with FileCheck? I think the answer is yes. We can migrate using the following steps:
-
XCTest's build_script.py test subcommand should take an optional path to a FileCheck executable to use when testing. At first, the option will do nothing.
-
The apple/swift build script should be modified to pass the path to FileCheck to the build script.
-
XCTest's lit.cfg should provide a
%{FileCheck}
substitution to the tests. -
Tests should migrate over from using the
%{xctest_checker}
substitution to the%{FileCheck}
substitution. -
Once all tests have been migrated, xctest-checker should be deleted.