aboutsummaryrefslogtreecommitdiff
path: root/test/core/src/lombok/AbstractRunTests.java
diff options
context:
space:
mode:
Diffstat (limited to 'test/core/src/lombok/AbstractRunTests.java')
-rw-r--r--test/core/src/lombok/AbstractRunTests.java23
1 files changed, 4 insertions, 19 deletions
diff --git a/test/core/src/lombok/AbstractRunTests.java b/test/core/src/lombok/AbstractRunTests.java
index d044a39f..1a454585 100644
--- a/test/core/src/lombok/AbstractRunTests.java
+++ b/test/core/src/lombok/AbstractRunTests.java
@@ -55,15 +55,15 @@ public abstract class AbstractRunTests {
this.dumpActualFilesHere = findPlaceToDumpActualFiles();
}
- public final FileTester createTester(final DirectoryRunner.TestParams params, final File file) throws IOException {
+ public final FileTester createTester(final DirectoryRunner.TestParams params, final File file, String platform, int version) throws IOException {
ConfigurationKeysLoader.LoaderLoader.loadAllConfigurationKeys();
AssertionError directiveFailure = null;
LombokTestSource sourceDirectives = null;
try {
sourceDirectives = LombokTestSource.readDirectives(file);
if (sourceDirectives.isIgnore()) return null;
- if (!sourceDirectives.versionWithinLimit(params.getVersion())) return null;
- if (!sourceDirectives.versionWithinLimit(getClasspathVersion())) return null;
+ if (!sourceDirectives.versionWithinLimit(version)) return null;
+ if (!sourceDirectives.runOnPlatform(platform)) return null;
} catch (AssertionError ae) {
directiveFailure = ae;
}
@@ -73,6 +73,7 @@ public abstract class AbstractRunTests {
if (expected.isIgnore()) return null;
if (!expected.versionWithinLimit(params.getVersion())) return null;
+ if (!expected.versionWithinLimit(version)) return null;
final LombokTestSource sourceDirectives_ = sourceDirectives;
final AssertionError directiveFailure_ = directiveFailure;
@@ -98,22 +99,6 @@ public abstract class AbstractRunTests {
};
}
- private static int getClasspathVersion() {
- try {
- Class.forName("java.lang.AutoCloseable");
- } catch (ClassNotFoundException e) {
- return 6;
- }
-
- try {
- Class.forName("java.util.stream.Stream");
- } catch (ClassNotFoundException e) {
- return 7;
- }
-
- return 8;
- }
-
protected abstract boolean transformCode(Collection<CompilerMessage> messages, StringWriter result, File file, String encoding, Map<String, String> formatPreferences) throws Throwable;
protected String readFile(File file) throws IOException {