Skip to content

Commit 4a88f2c

Browse files
committed
[Commands] Don't warn for empty test classes when generating linuxmain
It is common to have test classes with no tests to provide support code.
1 parent 9d7278c commit 4a88f2c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Sources/Commands/GenerateLinuxMain.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ final class LinuxMainGenerator {
4848
// Generate manifest file for each test module we got from XCTest discovery.
4949
for module in modules.lazy.sorted(by: { $0.name < $1.name }) {
5050
guard let target = graph.reachableTargets.first(where: { $0.c99name == module.name }) else {
51-
print("warning: did not file target '\(module.name)'")
51+
print("warning: did not find target '\(module.name)'")
5252
continue
5353
}
5454
assert(target.type == .test, "Unexpected target type \(target.type) for \(target)")
@@ -168,9 +168,8 @@ private final class ModulesBuilder {
168168
for testCase in cases {
169169
let (module, theKlass) = testCase.name.split(around: ".")
170170
guard let klass = theKlass else {
171-
// This should only happen if there are no tests in the test case.
171+
// Ignore the classes that have zero tests.
172172
if testCase.tests.isEmpty {
173-
print("warning: \(testCase.name) does not contain any tests")
174173
continue
175174
}
176175
fatalError("unreachable \(testCase.name)")

0 commit comments

Comments
 (0)