Skip to content

Commit f3771a8

Browse files
committed
Allow files with tests within nested classes to be recognised as test files
1 parent ec1a93b commit f3771a8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/com/facebook/buck/testrunner/JUnitRunner.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,13 @@ private boolean mightBeJunit5TestClass(Class<?> klass) {
170170
return true;
171171
}
172172
}
173+
174+
for (Class<?> c : klass.getDeclaredClasses()) {
175+
if (c.getDeclaredAnnotation(org.junit.jupiter.api.Nested.class) != null) {
176+
return mightBeJunit5TestClass(c);
177+
}
178+
}
179+
173180
return false;
174181
}
175182

0 commit comments

Comments
 (0)