aboutsummaryrefslogtreecommitdiff
path: root/test/core
diff options
context:
space:
mode:
authorReinier Zwitserloot <r.zwitserloot@projectlombok.org>2020-05-29 00:17:20 +0200
committerReinier Zwitserloot <r.zwitserloot@projectlombok.org>2020-06-23 15:55:18 +0200
commit0bbedd092a1f0f506d106943b4b400c7986c5f36 (patch)
treef07bdd4d4c2d69bd7e204d8e15e99209106aee3b /test/core
parent22ac024abb3680b298bef78052f5a13239513b29 (diff)
downloadlombok-0bbedd092a1f0f506d106943b4b400c7986c5f36.tar.gz
lombok-0bbedd092a1f0f506d106943b4b400c7986c5f36.tar.bz2
lombok-0bbedd092a1f0f506d106943b4b400c7986c5f36.zip
[build] rewriting the build system
Diffstat (limited to 'test/core')
-rw-r--r--test/core/src/lombok/DirectoryRunner.java12
-rw-r--r--test/core/src/lombok/RunTestsViaDelombok.java4
-rw-r--r--test/core/src/lombok/RunTestsViaEcj.java20
-rw-r--r--test/core/src/lombok/TestBase.java (renamed from test/core/src/lombok/RunAllTests.java)6
-rw-r--r--test/core/src/lombok/TestEclipse.java31
-rw-r--r--test/core/src/lombok/TestJavac.java32
6 files changed, 89 insertions, 16 deletions
diff --git a/test/core/src/lombok/DirectoryRunner.java b/test/core/src/lombok/DirectoryRunner.java
index b8b1da43..e4792ca9 100644
--- a/test/core/src/lombok/DirectoryRunner.java
+++ b/test/core/src/lombok/DirectoryRunner.java
@@ -82,8 +82,16 @@ public class DirectoryRunner extends Runner {
private static final FileFilter JAVA_FILE_FILTER = new FileFilter() {
@Override public boolean accept(File file) {
- return file.isFile() && file.getName().endsWith(".java") &&
- (DEBUG_FOCUS_ON_FILE.isEmpty() || DEBUG_FOCUS_ON_FILE.contains(file.getName()));
+ if (!file.isFile() || !file.getName().endsWith(".java")) return false;
+ boolean positiveFilter = false;
+ for (String dfof : DEBUG_FOCUS_ON_FILE) {
+ if (!dfof.endsWith(".java")) dfof = dfof + ".java";
+ boolean invert = dfof.startsWith("!");
+ if (invert) dfof = dfof.substring(1);
+ positiveFilter = positiveFilter || !invert;
+ if (file.getName().equals(dfof)) return !invert;
+ }
+ return !positiveFilter;
}
};
diff --git a/test/core/src/lombok/RunTestsViaDelombok.java b/test/core/src/lombok/RunTestsViaDelombok.java
index 0887de32..b766e7a4 100644
--- a/test/core/src/lombok/RunTestsViaDelombok.java
+++ b/test/core/src/lombok/RunTestsViaDelombok.java
@@ -29,16 +29,20 @@ import java.io.UnsupportedEncodingException;
import java.util.Collection;
import java.util.Locale;
import java.util.Map;
+import java.util.concurrent.atomic.AtomicBoolean;
import lombok.delombok.Delombok;
import lombok.javac.CapturingDiagnosticListener;
+import lombok.javac.Javac;
import lombok.javac.CapturingDiagnosticListener.CompilerMessage;
public class RunTestsViaDelombok extends AbstractRunTests {
private Delombok delombok = new Delombok();
+ private static AtomicBoolean compilerVersionReported = new AtomicBoolean();
@Override
public boolean transformCode(Collection<CompilerMessage> messages, StringWriter result, final File file, String encoding, Map<String, String> formatPreferences) throws Throwable {
+ if (!compilerVersionReported.getAndSet(true)) System.out.println("Javac version: " + Javac.getJavaCompilerVersion());
delombok.setVerbose(true);
ChangedChecker cc = new ChangedChecker();
delombok.setFeedback(cc.feedback);
diff --git a/test/core/src/lombok/RunTestsViaEcj.java b/test/core/src/lombok/RunTestsViaEcj.java
index 3efe38f5..77d1b75e 100644
--- a/test/core/src/lombok/RunTestsViaEcj.java
+++ b/test/core/src/lombok/RunTestsViaEcj.java
@@ -69,7 +69,8 @@ public class RunTestsViaEcj extends AbstractRunTests {
warnings.put(CompilerOptions.OPTION_ReportUnusedLabel, "ignore");
warnings.put(CompilerOptions.OPTION_ReportUnusedImport, "ignore");
warnings.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, "ignore");
- warnings.put(CompilerOptions.OPTION_Source, "1." + Eclipse.getEcjCompilerVersion());
+ int ecjVersion = Eclipse.getEcjCompilerVersion();
+ warnings.put(CompilerOptions.OPTION_Source, (ecjVersion < 9 ? "1." : "") + ecjVersion);
options.set(warnings);
return options;
}
@@ -137,16 +138,13 @@ public class RunTestsViaEcj extends AbstractRunTests {
}
if (new File("bin").exists()) classpath.add("bin");
classpath.add("dist/lombok.jar");
- classpath.add("lib/oracleJDK8Environment/rt.jar");
- classpath.add("lib/test/commons-logging-commons-logging.jar");
- classpath.add("lib/test/org.slf4j-slf4j-api.jar");
- classpath.add("lib/test/org.slf4j-slf4j-ext.jar");
- classpath.add("lib/test/log4j-log4j.jar");
- classpath.add("lib/test/org.apache.logging.log4j-log4j-api.jar");
- classpath.add("lib/test/org.jboss.logging-jboss-logging.jar");
- classpath.add("lib/test/com.google.guava-guava.jar");
- classpath.add("lib/test/com.google.code.findbugs-findbugs.jar");
- classpath.add("lib/test/com.google.flogger-flogger.jar");
+ classpath.add("lib/openjdk6_rt.jar");
+ for (File f : new File("lib/test").listFiles()) {
+ String fn = f.getName();
+ if (fn.length() < 4) continue;
+ if (!fn.substring(fn.length() - 4).toLowerCase().equals(".jar")) continue;
+ classpath.add("lib/test/" + fn);
+ }
return new FileSystem(classpath.toArray(new String[0]), new String[] {file.getAbsolutePath()}, "UTF-8");
}
}
diff --git a/test/core/src/lombok/RunAllTests.java b/test/core/src/lombok/TestBase.java
index 1ca76af5..4b0c02f3 100644
--- a/test/core/src/lombok/RunAllTests.java
+++ b/test/core/src/lombok/TestBase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011-2015 The Project Lombok Authors.
+ * Copyright (C) 2011-2020 The Project Lombok Authors.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -26,6 +26,6 @@ import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
@RunWith(Suite.class)
-@SuiteClasses({lombok.transform.RunTransformTests.class, lombok.bytecode.RunBytecodeTests.class, lombok.core.configuration.RunConfigurationTests.class, lombok.core.RunCoreTests.class})
-public class RunAllTests {
+@SuiteClasses({lombok.core.configuration.RunConfigurationTests.class, lombok.core.RunCoreTests.class})
+public class TestBase {
}
diff --git a/test/core/src/lombok/TestEclipse.java b/test/core/src/lombok/TestEclipse.java
new file mode 100644
index 00000000..9fe798bc
--- /dev/null
+++ b/test/core/src/lombok/TestEclipse.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2011-2020 The Project Lombok Authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+package lombok;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+@RunWith(Suite.class)
+@SuiteClasses({lombok.transform.TestWithEcj.class})
+public class TestEclipse {
+}
diff --git a/test/core/src/lombok/TestJavac.java b/test/core/src/lombok/TestJavac.java
new file mode 100644
index 00000000..340abb35
--- /dev/null
+++ b/test/core/src/lombok/TestJavac.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2011-2020 The Project Lombok Authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+package lombok;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+@RunWith(Suite.class)
+//@SuiteClasses({lombok.bytecode.RunBytecodeTests.class, lombok.transform.TestLombokFilesIdempotent.class, lombok.transform.TestSourceFiles.class, lombok.transform.TestWithDelombok.class})
+@SuiteClasses({lombok.transform.TestLombokFilesIdempotent.class})
+public class TestJavac {
+}