Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2019-09-05 18:02:13 +0000
committerStephan Herrmann2019-09-19 16:36:56 +0000
commit37b62268dadda16a223231f49c86cc536a31c727 (patch)
tree4dca6ed48a66044b69c9bcc096f0be65e1f48c63 /org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java
parent2111b8f107adf2724a1966e767cf67f8a5fc72b3 (diff)
downloadorg.eclipse.objectteams-37b62268dadda16a223231f49c86cc536a31c727.tar.gz
org.eclipse.objectteams-37b62268dadda16a223231f49c86cc536a31c727.tar.xz
org.eclipse.objectteams-37b62268dadda16a223231f49c86cc536a31c727.zip
Initial update to BETA_JAVA13 as of Y20190829-0900
Diffstat (limited to 'org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java')
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java46
1 files changed, 38 insertions, 8 deletions
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java
index d2f57f1d9..53389d33a 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java
@@ -304,6 +304,8 @@ static class JavacCompiler {
return JavaCore.VERSION_11;
} else if(rawVersion.startsWith("12")) {
return JavaCore.VERSION_12;
+ } else if(rawVersion.startsWith("13")) {
+ return JavaCore.VERSION_13;
} else {
throw new RuntimeException("unknown javac version: " + rawVersion);
}
@@ -425,6 +427,20 @@ static class JavacCompiler {
return 0200;
}
}
+ if (version == JavaCore.VERSION_13) {
+ if ("13-ea".equals(rawVersion)) {
+ return 0000;
+ }
+ if ("13".equals(rawVersion)) {
+ return 0000;
+ }
+ if ("13.0.1".equals(rawVersion)) {
+ return 0100;
+ }
+ if ("13.0.2".equals(rawVersion)) {
+ return 0200;
+ }
+ }
throw new RuntimeException("unknown raw javac version: " + rawVersion);
}
// returns 0L if everything went fine; else the lower word contains the
@@ -570,6 +586,20 @@ protected static class JavacTestOptions {
throw new IllegalArgumentException("preview not supported at release "+release);
return options;
}
+ @java.lang.SuppressWarnings("synthetic-access")
+ static JavacTestOptions forReleaseWithPreview(String release, String additionalOptions) {
+ JavacTestOptions options = new JavacTestOptions(Long.parseLong(release));
+ if (isJRE9Plus) {
+ String result = "--release "+release+" --enable-preview -Xlint:-preview";
+ if (additionalOptions != null)
+ result = result + " " + additionalOptions;
+ options.setCompilerOptions(result);
+
+ }
+ else
+ throw new IllegalArgumentException("preview not supported at release "+release);
+ return options;
+ }
public static class SuppressWarnings extends JavacTestOptions {
public SuppressWarnings(String token) {
setCompilerOptions("-Xlint:-"+token);
@@ -952,7 +982,7 @@ protected static class JavacTestOptions {
JavacBug8144832 = RUN_JAVAC ? // https://bugs.openjdk.java.net/browse/JDK-8144832
new JavacHasABug(MismatchType.JavacErrorsEclipseNone, ClassFileConstants.JDK9, 0000) : null,
JavacBug8179483_switchExpression = RUN_JAVAC ? // https://bugs.openjdk.java.net/browse/JDK-8179483
- new JavacBug8179483(" --release 12 --enable-preview -Xlint:-preview") : null,
+ new JavacBug8179483(" --release 13 --enable-preview -Xlint:-preview") : null,
JavacBug8221413_switchExpression = RUN_JAVAC ? // https://bugs.openjdk.java.net/browse/JDK-8221413
new JavacBug8221413(" --release 12 --enable-preview -Xlint:-preview") : null,
JavacBug8226510_switchExpression = RUN_JAVAC ? // https://bugs.openjdk.java.net/browse/JDK-8226510
@@ -1767,7 +1797,7 @@ protected static class JavacTestOptions {
skipJavac ? JavacTestOptions.SKIP :
javacTestOptions != null ? javacTestOptions : JavacTestOptions.DEFAULT /* default javac test options */);
}
- protected void runConformTest(String[] testFiles, Map customOptions) {
+ protected void runConformTest(String[] testFiles, Map<String, String> customOptions) {
runTest(
// test directory preparation
true /* flush output directory */,
@@ -1789,10 +1819,10 @@ protected static class JavacTestOptions {
// javac options
JavacTestOptions.DEFAULT /* default javac test options */);
}
- protected void runConformTest(String[] testFiles, String expectedOutput, Map customOptions) {
+ protected void runConformTest(String[] testFiles, String expectedOutput, Map<String, String> customOptions) {
runConformTest(testFiles, expectedOutput, customOptions, null);
}
- protected void runConformTest(String[] testFiles, String expectedOutput, Map customOptions, String[] vmArguments) {
+ protected void runConformTest(String[] testFiles, String expectedOutput, Map<String, String> customOptions, String[] vmArguments) {
runTest(
// test directory preparation
true /* flush output directory */,
@@ -1873,7 +1903,7 @@ protected static class JavacTestOptions {
String[] classLibraries,
boolean shouldFlushOutputDirectory,
String[] vmArguments,
- Map customOptions,
+ Map<String, String> customOptions,
ICompilerRequestor customRequestor) {
runTest(
// test directory preparation
@@ -2961,7 +2991,7 @@ protected void runNegativeTest(boolean skipJavac, JavacTestOptions javacTestOpti
String[] testFiles,
// compiler options
String[] classLibraries,
- Map customOptions,
+ Map<String, String> customOptions,
boolean performStatementsRecovery,
ICompilerRequestor customRequestor,
// compiler results
@@ -3106,7 +3136,7 @@ protected void runNegativeTest(boolean skipJavac, JavacTestOptions javacTestOpti
// compiler options
String[] classLibraries,
boolean libsOnModulePath,
- Map customOptions,
+ Map<String, String> customOptions,
boolean performStatementsRecovery,
ICompilerRequestor customRequestor,
// compiler results
@@ -3146,7 +3176,7 @@ protected void runNegativeTest(boolean skipJavac, JavacTestOptions javacTestOpti
requestor.outputPath = OUTPUT_DIR.endsWith(File.separator) ? OUTPUT_DIR : OUTPUT_DIR + File.separator;
// WORK should not have to test a constant?
- Map options = getCompilerOptions();
+ Map<String, String> options = getCompilerOptions();
if (customOptions != null) {
options.putAll(customOptions);
}

Back to the top