You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Provides usage and examples on --help, -h, or and invalid option
- Examples are customized based on the tests contained in the executable
and the executable name
For example, for Foundation's TestFoundation:
```
> TestFoundation --invalid
Error: Invalid option "--invalid"
Usage: TestFoundation.exe [OPTION]
TestFoundation.exe [TESTCASE]
Run and report results of test cases.
With no OPTION or TESTCASE, runs all test cases.
-h, --help Print this help message
-l, --list-test List tests line by line to standard output
--dump-tests-json List tests in JSON to standard output
Examples:
Run a single test
> TestFoundation.exe TestFoundation.TestAffineTransform/test_BasicConstruction
Run all the tests in TestFoundation.TestAffineTransform
> TestFoundation.exe TestFoundation.TestAffineTransform
```
Copy file name to clipboardExpand all lines: Sources/XCTest/Public/XCTestMain.swift
+35-4Lines changed: 35 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@
28
28
29
29
/// Starts a test run for the specified test cases.
30
30
///
31
-
/// This function will not return. If the test cases pass, then it will call `exit(0)`. If there is a failure, then it will call `exit(1)`.
31
+
/// This function will not return. If the test cases pass, then it will call `exit(EXIT_SUCCESS)`. If there is a failure, then it will call `exit(EXIT_FAILURE)`.
32
32
/// Example usage:
33
33
///
34
34
/// class TestFoo: XCTestCase {
@@ -83,10 +83,41 @@ public func XCTMain(_ testCases: [XCTestCaseEntry]) -> Never {
0 commit comments