Skip to content

Commit acce16c

Browse files
committed
[xcodeproj] Share test scheme
- Allow the `SwiftXCTestFunctionalTests` scheme to be run from the command-line, by marking it as a "shared" scheme in Xcode. - Add instructions on how to run the tests via the command line to the README. Allowing the tests to be run via the command-line on all platforms is necessary for integrating swift-corelibs-xctest tests into the greater Swift test suite. (See: https://github.com/apple/swift/blob/162becc91e1eab9118a17c34f994e79d5983819f/utils/build-script-impl#L1968-L1974)
1 parent 0a33c52 commit acce16c

File tree

2 files changed

+85
-1
lines changed

2 files changed

+85
-1
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@ install XCTest in your active version of Swift:
5151
--test
5252
```
5353

54-
To run the tests on OS X, build and run the `SwiftXCTestFunctionalTests` target in the Xcode project.
54+
To run the tests on OS X, build and run the `SwiftXCTestFunctionalTests` target in the Xcode project. You may also run them via the command line:
55+
56+
```
57+
xcodebuild -project XCTest.xcodeproj -scheme SwiftXCTestFunctionalTests
58+
```
5559

5660
You may add tests for XCTest by including them in the `Tests/Functional/` directory. For an example, see `Tests/Functional/SingleFailingTestCase`.
5761

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "0720"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "DAA333B51C267AD6000CC115"
18+
BuildableName = "SwiftXCTestFunctionalTests"
19+
BlueprintName = "SwiftXCTestFunctionalTests"
20+
ReferencedContainer = "container:XCTest.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
</Testables>
32+
<AdditionalOptions>
33+
</AdditionalOptions>
34+
</TestAction>
35+
<LaunchAction
36+
buildConfiguration = "Debug"
37+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
38+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
39+
launchStyle = "0"
40+
useCustomWorkingDirectory = "NO"
41+
ignoresPersistentStateOnLaunch = "NO"
42+
debugDocumentVersioning = "YES"
43+
debugServiceExtension = "internal"
44+
allowLocationSimulation = "YES">
45+
<MacroExpansion>
46+
<BuildableReference
47+
BuildableIdentifier = "primary"
48+
BlueprintIdentifier = "DAA333B51C267AD6000CC115"
49+
BuildableName = "SwiftXCTestFunctionalTests"
50+
BlueprintName = "SwiftXCTestFunctionalTests"
51+
ReferencedContainer = "container:XCTest.xcodeproj">
52+
</BuildableReference>
53+
</MacroExpansion>
54+
<AdditionalOptions>
55+
</AdditionalOptions>
56+
</LaunchAction>
57+
<ProfileAction
58+
buildConfiguration = "Release"
59+
shouldUseLaunchSchemeArgsEnv = "YES"
60+
savedToolIdentifier = ""
61+
useCustomWorkingDirectory = "NO"
62+
debugDocumentVersioning = "YES">
63+
<MacroExpansion>
64+
<BuildableReference
65+
BuildableIdentifier = "primary"
66+
BlueprintIdentifier = "DAA333B51C267AD6000CC115"
67+
BuildableName = "SwiftXCTestFunctionalTests"
68+
BlueprintName = "SwiftXCTestFunctionalTests"
69+
ReferencedContainer = "container:XCTest.xcodeproj">
70+
</BuildableReference>
71+
</MacroExpansion>
72+
</ProfileAction>
73+
<AnalyzeAction
74+
buildConfiguration = "Debug">
75+
</AnalyzeAction>
76+
<ArchiveAction
77+
buildConfiguration = "Release"
78+
revealArchiveInOrganizer = "YES">
79+
</ArchiveAction>
80+
</Scheme>

0 commit comments

Comments
 (0)