uschindler commented on code in PR #15623:
URL: https://github.com/apache/lucene/pull/15623#discussion_r2779690930
##########
build-tools/build-infra/src/main/java/org/apache/lucene/gradle/plugins/java/TestsAndRandomizationPlugin.java:
##########
@@ -601,4 +632,114 @@ private static boolean addVectorizationOptions(
return defaultVectorizationOption.get();
}
+
+ public abstract static class LuceneTestFramework implements TestFramework {
+ private final DefaultTestFilter filter;
+ private final Factory<File> testTaskTemporaryDir;
+ private final Provider<Boolean> dryRun;
+ private TestFrameworkDetector detector =
+ new TestFrameworkDetector() {
+ private TestDefinitionProcessor<? super ClassTestDefinition>
testDefinitionProcessor;
+
+ @Override
+ public void startDetection(
+ TestDefinitionProcessor<? super ClassTestDefinition>
testDefinitionProcessor) {
+ this.testDefinitionProcessor = testDefinitionProcessor;
+ }
+
+ @Override
+ public boolean processTestClass(RelativeFile testClassFile) {
+ var cc =
+ ClassFile.of(
+ ClassFile.ConstantPoolSharingOption.NEW_POOL,
+ ClassFile.DebugElementsOption.DROP_DEBUG,
+ ClassFile.LineNumbersOption.DROP_LINE_NUMBERS,
+ ClassFile.StackMapsOption.DROP_STACK_MAPS);
+
+ try {
+ ClassModel parsed = cc.parse(testClassFile.getFile().toPath());
+ String internalName =
parsed.thisClass().asInternalName().replace('/', '.');
+ testDefinitionProcessor.processTestDefinition(new
ClassTestDefinition(internalName));
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
Review Comment:
It won't parse the full file. So should be fine.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]