Skip to content

Commit f1a2129

Browse files
committed
[xcodeproj] Better lit output
Because Xcode treats the default lit output as error, simply running `lit Tests/Functional` causes build failures in Xcode. For this reason, the script was run with the `-q` quiet parameter. However, this made it difficult to understand why a test failed. This commit borrows a page from LLVM (see: https://github.com/apple/swift-llvm/blob/3ebdbb2c7e5ce577363994fd0aa0f8409bc68490/CMakeLists.txt#L329-L332) and uses `-s` (summarize results), `-v` (verbose), and `--no-progress-bar`. This combination emits diagnostics that are not treated as errors by Xcode, *and* they provide a great deal of detail when tests fail--the best of both worlds!
1 parent e5cf2f4 commit f1a2129

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

XCTest.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@
219219
/* Begin PBXLegacyTarget section */
220220
DAA333B51C267AD6000CC115 /* SwiftXCTestFunctionalTests */ = {
221221
isa = PBXLegacyTarget;
222-
buildArgumentsString = "-q Tests/Functional";
222+
buildArgumentsString = "-sv --no-progress-bar Tests/Functional";
223223
buildConfigurationList = DAA333B81C267AD6000CC115 /* Build configuration list for PBXLegacyTarget "SwiftXCTestFunctionalTests" */;
224224
buildPhases = (
225225
);

build_script.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,13 @@ def main():
139139
if args.test:
140140
lit_path = os.path.join(
141141
os.path.dirname(SOURCE_DIR), 'llvm', 'utils', 'lit', 'lit.py')
142+
lit_flags = '-sv --no-progress-bar'
142143
tests_path = os.path.join(SOURCE_DIR, 'Tests', 'Functional')
143-
run('SWIFT_EXEC={swiftc} {lit_path} {tests_path}'.format(
144-
swiftc=swiftc, lit_path=lit_path, tests_path=tests_path))
144+
run('SWIFT_EXEC={swiftc} {lit_path} {lit_flags} '
145+
'{tests_path}'.format(swiftc=swiftc,
146+
lit_path=lit_path,
147+
lit_flags=lit_flags,
148+
tests_path=tests_path))
145149

146150
note('Done.')
147151

0 commit comments

Comments
 (0)