Skip to content

Commit d124fac

Browse files
committed
Add a test that files with unknown extensions are treated as compilable in 5.3 manifests (there would still be a later error about mismatched languages in a single target.
1 parent 273a4ef commit d124fac

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

Tests/PackageLoadingTests/PackageBuilderTests.swift

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1683,6 +1683,30 @@ class PackageBuilderTests: XCTestCase {
16831683
}
16841684
}
16851685

1686+
func testUnknownSourceFilesUnderDeclaredSourcesCompiledInV5_3Manifest() throws {
1687+
// Files with unknown suffixes under declared sources are treated as compilable in 5.3 manifest.
1688+
let fs = InMemoryFileSystem(emptyFiles:
1689+
"/Sources/lib/movie.mkv",
1690+
"/Sources/lib/lib.c",
1691+
"/Sources/lib/include/lib.h"
1692+
)
1693+
1694+
let manifest = Manifest.createManifest(
1695+
name: "pkg",
1696+
v: .v5_3,
1697+
targets: [
1698+
TargetDescription(name: "lib", dependencies: [], path: "./Sources/lib", sources: ["."]),
1699+
]
1700+
)
1701+
1702+
PackageBuilderTester(manifest, in: fs) { package, _ in
1703+
package.checkModule("lib") { module in
1704+
module.checkSources(root: "/Sources/lib", paths: "movie.mkv", "lib.c")
1705+
module.check(includeDir: "/Sources/lib/include")
1706+
}
1707+
}
1708+
}
1709+
16861710
func testBuildSettings() {
16871711
let fs = InMemoryFileSystem(emptyFiles:
16881712
"/Sources/exe/main.swift",

0 commit comments

Comments
 (0)