|
10 | 10 | // XCTestSuite.swift
|
11 | 11 | // A collection of test cases.
|
12 | 12 | //
|
| 13 | +// A subclass of XCTest, XCTestSuite is a collection of test cases. Based on |
| 14 | +// what's passed into XCTMain(), a hierarchy of suites is built up, but |
| 15 | +// XCTestSuite can also be instantiated and manipulated directly: |
| 16 | +// |
| 17 | +// let suite = XCTestSuite(name: "My Tests") |
| 18 | +// suite.addTest(myTest) |
| 19 | +// suite.testCaseCount // 1 |
| 20 | +// suite.run() |
13 | 21 |
|
14 |
| -/// A concrete subclass of XCTest, XCTestSuite is a collection of test cases. |
15 |
| -/// Suites are usually managed by the IDE, but XCTestSuite also provides API |
16 |
| -/// for dynamic test and suite management: |
17 |
| -/// |
18 |
| -/// XCTestSuite *suite = [XCTestSuite testSuiteWithName:@"My tests"]; |
19 |
| -/// [suite addTest:[MathTest testCaseWithSelector:@selector(testAdd)]]; |
20 |
| -/// [suite addTest:[MathTest testCaseWithSelector:@selector(testDivideByZero)]]; |
21 |
| -/// |
22 |
| -/// Alternatively, a test suite can extract the tests to be run automatically. |
23 |
| -/// To do so, pass the class of your test case class to the suite's constructor: |
24 |
| -/// |
25 |
| -/// XCTestSuite *suite = [XCTestSuite testSuiteForTestCaseClass:[MathTest class]]; |
26 |
| -/// |
27 |
| -/// This creates a suite with all the methods starting with "test" that take no |
28 |
| -/// arguments. Also, a test suite of all the test cases found in the runtime |
29 |
| -/// can be created automatically: |
30 |
| -/// |
31 |
| -/// XCTestSuite *suite = [XCTestSuite defaultTestSuite]; |
32 |
| -/// |
33 |
| -/// This creates a suite of suites with all the XCTestCase subclasses methods |
34 |
| -/// that start with "test" and take no arguments. |
35 | 22 | public class XCTestSuite: XCTest {
|
36 | 23 | public private(set) var tests = [XCTest]()
|
37 | 24 |
|
|
0 commit comments