Skip to content

Commit 426d4fb

Browse files
committed
Add tests for excludes inside Tests dir
1 parent b58e268 commit 426d4fb

File tree

8 files changed

+36
-0
lines changed

8 files changed

+36
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import PackageDescription
2+
3+
let package = Package(
4+
name: "FooPackage",
5+
exclude: ["Tests/Fixtures"]
6+
)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print("hello")

Fixtures/Miscellaneous/ExcludeDiagnostic4/Tests/Fixtures/Foo.txt

Whitespace-only changes.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import PackageDescription
2+
3+
let package = Package(
4+
name: "FooPackage",
5+
exclude: ["Tests"]
6+
)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print("hello")

Fixtures/Miscellaneous/ExcludeDiagnostic5/Tests/Fixtures/Foo.txt

Whitespace-only changes.

Tests/Functional/TestMiscellaneous.swift

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,26 @@ class MiscellaneousTestCase: XCTestCase {
6969
XCTAssertNoSuchPath(prefix, "App", ".build", "debug", "some")
7070
}
7171
}
72+
73+
func testManifestExcludes4() {
74+
75+
// exclude directory is inside Tests folder (Won't build without exclude)
76+
77+
fixture(name: "Miscellaneous/ExcludeDiagnostic4") { prefix in
78+
XCTAssertBuilds(prefix)
79+
XCTAssertFileExists(prefix, ".build", "debug", "FooPackage.swiftmodule")
80+
}
81+
}
82+
83+
func testManifestExcludes5() {
84+
85+
// exclude directory is Tests folder (Won't build without exclude)
86+
87+
fixture(name: "Miscellaneous/ExcludeDiagnostic5") { prefix in
88+
XCTAssertBuilds(prefix)
89+
XCTAssertFileExists(prefix, ".build", "debug", "FooPackage.swiftmodule")
90+
}
91+
}
7292

7393
func testTestDependenciesSimple() {
7494
#if false

Tests/Functional/TestValidLayouts.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ extension MiscellaneousTestCase: XCTestCaseProvider {
164164
("testManifestExcludes1", testManifestExcludes1),
165165
("testManifestExcludes2", testManifestExcludes2),
166166
("testManifestExcludes3", testManifestExcludes3),
167+
("testManifestExcludes4", testManifestExcludes4),
168+
("testManifestExcludes5", testManifestExcludes5),
167169
("testTestDependenciesSimple", testTestDependenciesSimple),
168170
("testTestDependenciesComplex", testTestDependenciesComplex),
169171
("testPassExactDependenciesToBuildCommand", testPassExactDependenciesToBuildCommand),

0 commit comments

Comments
 (0)