From d6191d1cad09f5bb80a650f92ae6294b39dea5ef Mon Sep 17 00:00:00 2001 From: Ilia Kirianovskii Date: Thu, 15 Jan 2026 13:03:31 +0100 Subject: [PATCH] [build] Add UltimateProjectTestsStructureTest#`no @PerformanceUnitTest methods in junit5 performance tests` test (in intellij.idea.ultimate.build.tests module) to check that no unsupported junit5 performance tests (IJI-3451) Also adds includeEverything optional parameter in ClassFinder to specify whether all classes should be matched. GitOrigin-RevId: 1596b333da370e81e2667516357f9c5514623cb0 --- .../core/src/com/intellij/ClassFinder.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/platform/testFramework/core/src/com/intellij/ClassFinder.java b/platform/testFramework/core/src/com/intellij/ClassFinder.java index b9f4f0ad94fe..ea6de73ec962 100644 --- a/platform/testFramework/core/src/com/intellij/ClassFinder.java +++ b/platform/testFramework/core/src/com/intellij/ClassFinder.java @@ -22,10 +22,16 @@ public class ClassFinder { private final List classNameList; private final Path classPathRoot; private final boolean includeUnconventionallyNamedTests; + private final boolean includeEverything; public ClassFinder(final Path classPathRoot, final String rootPackage, boolean includeUnconventionallyNamedTests) { + this(classPathRoot, rootPackage, includeUnconventionallyNamedTests, false); + } + + public ClassFinder(final Path classPathRoot, final String rootPackage, boolean includeUnconventionallyNamedTests, boolean includeEverything) { this.classPathRoot = classPathRoot; this.includeUnconventionallyNamedTests = includeUnconventionallyNamedTests; + this.includeEverything = includeEverything; String directoryOffset = rootPackage.replace(".", classPathRoot.getFileSystem().getSeparator()); if (Files.isRegularFile(classPathRoot)) { classNameList = findAndStoreTestClassesFromJar(directoryOffset); @@ -38,6 +44,12 @@ public class ClassFinder { private @Nullable String computeClassName(final @NotNull Path path, final @NotNull Path root) { Path absPath = path.toAbsolutePath(); String fileName = absPath.getFileName().toString(); + if (includeEverything) { + if (fileName.endsWith(".class")) { + return getClassFQN(absPath, root); + } + return null; + } if (!includeUnconventionallyNamedTests) { // It's faster and easier to check for `endsWith` rather than `extensionEquals` (see below) which does `endsWith` if (fileName.endsWith("Test.class")) {