mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[junit]: IDEA-386776 JUnit version detection with customizable scope via registry key
(cherry picked from commit 07c6ae4bc0abecb3b2f09091a9f4b5b432ee437f) IJ-CR-195055 GitOrigin-RevId: e33987390d856deb2974826e17eabd3b7752e535
This commit is contained in:
committed by
intellij-monorepo-bot
parent
199a0c9301
commit
577faf357d
@@ -160,6 +160,9 @@
|
||||
<registryKey key="idea.test.graceful.shutdown.timeout.seconds"
|
||||
defaultValue="600"
|
||||
description="Timeout in seconds for the test runner to terminate gracefully after receiving a shutdown signal. A negative value disables the timeout, allowing unlimited wait."/>
|
||||
<registryKey key="junit.version.detection.scope"
|
||||
defaultValue="withDependenciesAndLibraries"
|
||||
description="Scope used to detect the JUnit version in a module. Supported values: 'runtime' (module runtime), 'module' (module only), 'testsWithDependents' (tests with dependent modules), 'WithLibraries' (module with libraries), and 'withDependenciesAndLibraries' (module with dependencies and libraries; used by default)."/>
|
||||
</extensions>
|
||||
|
||||
<extensionPoints>
|
||||
|
||||
@@ -640,7 +640,14 @@ public abstract class TestObject extends JavaTestFrameworkRunnableState<JUnitCon
|
||||
}
|
||||
|
||||
private static GlobalSearchScope getScopeForJUnit(@Nullable Module module, Project project) {
|
||||
return module != null ? GlobalSearchScope.moduleWithDependenciesAndLibrariesScope(module, true) : GlobalSearchScope.allScope(project);
|
||||
if (module == null) return GlobalSearchScope.allScope(project);
|
||||
return switch (Registry.stringValue("junit.version.detection.scope")) {
|
||||
case "runtime" -> GlobalSearchScope.moduleRuntimeScope(module, true);
|
||||
case "module" -> GlobalSearchScope.moduleScope(module);
|
||||
case "testsWithDependents" -> GlobalSearchScope.moduleTestsWithDependentsScope(module);
|
||||
case "WithLibraries" -> GlobalSearchScope.moduleWithLibrariesScope(module);
|
||||
default -> GlobalSearchScope.moduleWithDependenciesAndLibrariesScope(module, true);
|
||||
};
|
||||
}
|
||||
|
||||
public static GlobalSearchScope getScopeForJUnit(JUnitConfiguration configuration) {
|
||||
|
||||
Reference in New Issue
Block a user