Skip to content

Commit 44c84a7

Browse files
committed
Add test for Test module.
Check that Package.xctest are generated.
1 parent 66c9fb2 commit 44c84a7

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

Fixtures/SwiftTesting/SingleTarget/Package.swift

Whitespace-only changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
func ten() -> Int {
2+
return 10
3+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@testable import Foo
2+
import XCTest
3+
4+
class SimpleGetTests: XCTestCase {
5+
6+
func testGetRequestStatusCode() {
7+
XCTAssertEqual(ten(), 10)
8+
}
9+
}

Tests/Functional/TestMiscellaneous.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,4 +342,12 @@ class MiscellaneousTestCase: XCTestCase {
342342
XCTAssertEqual(output, "Goodbye\n")
343343
}
344344
}
345+
346+
func testModuleWithTests() {
347+
fixture(name: "SwiftTesting/SingleTarget", file: #file, line: #line) { prefix in
348+
XCTAssertBuilds(prefix)
349+
XCTAssertDirectoryExists(prefix, ".build", "debug", "Package.xctest")
350+
XCTAssertFileExists(prefix, ".build", "debug", "Foo.swiftmodule")
351+
}
352+
}
345353
}

0 commit comments

Comments
 (0)