Skip to content

Commit b5cd065

Browse files
committed
Fix building issues
1 parent 9fac493 commit b5cd065

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

Sources/Transmute/Package+testModules.swift

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,21 @@ extension Package {
1919
let rootTestFiles = files.filter {
2020
!$0.hasSuffix("LinuxMain.swift") && isValidSource($0) && !excludes.contains($0)
2121
}
22-
23-
guard testDirectories.count > 0 && rootTestFiles.count > 0 else {
24-
throw ModuleError.InvalidLayout(.InvalidLayout)
25-
}
2622

2723
if (testDirectories.count > 0) {
24+
if (rootTestFiles.count > 0) {
25+
throw ModuleError.InvalidLayout(.InvalidLayout)
26+
}
2827
return try testDirectories.map {
2928
TestModule(basename: $0.basename, sources: try self.sourcify($0))
3029
}
31-
} else {
32-
if (rootTestFiles.count > 0) {
33-
let rootTestSource = Sources(paths: rootTestFiles, root: path)
34-
return [TestModule(basename: name, sources: rootTestSource)]
30+
} else if (rootTestFiles.count > 0) {
31+
if (testDirectories.count > 0) {
32+
throw ModuleError.InvalidLayout(.InvalidLayout)
3533
}
34+
35+
let rootTestSource = Sources(paths: rootTestFiles, root: path)
36+
return [TestModule(basename: name, sources: rootTestSource)]
3637
}
3738

3839
return []

0 commit comments

Comments
 (0)