void (String rootPackage, List<? extends Path> classesRoots) { long t = System.nanoTime(); for (Path classesRoot : classesRoots) { int count = getClassesCount(); ClassFinder classFinder = new ClassFinder(classesRoot, rootPackage, INCLUDE_UNCONVENTIONALLY_NAMED_TESTS); loadTestCases(classesRoot.getFileName().toString(), classFinder.getClasses()); count = getClassesCount() - count; if (count > 0) { System.out.println("Loaded " + count + " classes from class root " + classesRoot); } } if (myClassSet.isEmpty()) { // nothing to test clearClasses(); } t = (System.nanoTime() - t) / 1_000_000; System.out.println("Loaded " + getClassesCount() + " classes in " + t + " ms"); if (!RUN_ONLY_AFFECTED_TESTS && getClassesCount() == 0 && !Boolean.getBoolean("idea.tests.ignoreJUnit3EmptySuite")) { // Specially formatted error message will fail the build // See https://www.jetbrains.com/help/teamcity/build-script-interaction-with-teamcity.html#BuildScriptInteractionwithTeamCity-ReportingMessagesForBuildLog System.out.println( "##teamcity[message text='Expected some junit 3 or junit 4 tests to be executed, but no test classes were found. " + "If all your tests are junit 5 and you do not expect old junit tests to be executed, please pass vm option " + "-Didea.tests.ignoreJUnit3EmptySuite=true' status='ERROR']"); } }