void (JavaParameters javaParameters, Module module, PsiJavaModule prodModule) { CompilerModuleExtension compilerExt = CompilerModuleExtension.getInstance(module); if (compilerExt == null) return; JavaParametersUtil.putDependenciesOnModulePath(javaParameters, prodModule, true); ParametersList vmParametersList = javaParameters.getVMParametersList() .addParamsGroup(JIGSAW_OPTIONS) .getParametersList(); String prodModuleName = prodModule.getName(); //ensure test output is merged to the production module VirtualFile testOutput = compilerExt.getCompilerOutputPathForTests(); if (testOutput != null) { vmParametersList.add("--patch-module"); vmParametersList.add(new CompositeParameterTargetedValue().addLocalPart(prodModuleName + "=").addPathPart(testOutput.getPath())); } //ensure test dependencies missing from production module descriptor are available in tests //todo enumerate all test dependencies explicitly vmParametersList.add("--add-reads"); vmParametersList.add(prodModuleName + "=ALL-UNNAMED"); //open packages with tests to test runner List<String> opensOptions = new ArrayList<>(); collectPackagesToOpen(opensOptions); for (String option : opensOptions) { if (option.isEmpty()) continue; vmParametersList.add("--add-opens"); vmParametersList.add(prodModuleName + "/" + option + "=ALL-UNNAMED"); } //ensure production module is explicitly added as test starter in `idea-rt` doesn't depend on it vmParametersList.add("--add-modules"); vmParametersList.add(prodModuleName); }