Skip to content

Commit

Permalink
prepare SealedTypesTest for -Drun.javac=enabled (#3204)
Browse files Browse the repository at this point in the history
test infra structure:
+ prefer dynamic shouldRunJavac() over RUN_JAVAC where possible
+ add option to say "-Drun.javac=optIn" to let test classes opt in
   - classes opt in via new field runJavacOptIn
+ make initialization of excuse constants unconditional
+ update path detection for Java 9+ (no longer points to "/jre")
+ detect more service versions of recent java versions

let SealedClassesTest opt in to run.javac
+ add test & excuse concerning JDK-8343306
  • Loading branch information
stephan-herrmann authored Nov 1, 2024
1 parent 2b9bdcb commit e8ce5b1
Show file tree
Hide file tree
Showing 6 changed files with 323 additions and 262 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ protected Set<String> runConformModuleTest(String[] testFiles, String commandLin
protected Set<String> runConformModuleTest(String[] testFiles, String commandLine, String expectedFailureOutOutputString, String expectedFailureErrOutputString, boolean shouldFlushOutputDirectory, String output,
JavacTestOptions options, String javacCommandLine) {
runConformTest(testFiles, commandLine, expectedFailureOutOutputString, expectedFailureErrOutputString, shouldFlushOutputDirectory);
if (RUN_JAVAC) {
if (shouldRunJavac()) {
File outputDir = new File(output);
final Set<String> outFiles = new HashSet<>();
walkOutFiles(output, outFiles, true);
Expand Down Expand Up @@ -212,7 +212,7 @@ protected void runNegativeModuleTest(String[] testFiles, String commandLine, Str
void runNegativeModuleTest(String[] testFiles, String commandLine, String expectedFailureOutOutputString, String expectedFailureErrOutputString, boolean shouldFlushOutputDirectory, String javacErrorMatch,
String output, JavacTestOptions options) {
runNegativeTest(testFiles, commandLine, expectedFailureOutOutputString, expectedFailureErrOutputString, shouldFlushOutputDirectory);
if (RUN_JAVAC) {
if (shouldRunJavac()) {
String[] testFileNames = new String[testFiles.length/2];
for (int i = 0; i < testFileNames.length; i++) {
testFileNames[i] = testFiles[i*2];
Expand Down
Loading

0 comments on commit e8ce5b1

Please sign in to comment.