aboutsummaryrefslogtreecommitdiff
path: root/test/src/jdk/nashorn/internal/codegen/CompilerTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'test/src/jdk/nashorn/internal/codegen/CompilerTest.java')
-rw-r--r--test/src/jdk/nashorn/internal/codegen/CompilerTest.java19
1 files changed, 14 insertions, 5 deletions
diff --git a/test/src/jdk/nashorn/internal/codegen/CompilerTest.java b/test/src/jdk/nashorn/internal/codegen/CompilerTest.java
index 1ebb97a2..61d896b6 100644
--- a/test/src/jdk/nashorn/internal/codegen/CompilerTest.java
+++ b/test/src/jdk/nashorn/internal/codegen/CompilerTest.java
@@ -25,9 +25,8 @@
package jdk.nashorn.internal.codegen;
-import static jdk.nashorn.internal.runtime.Source.sourceFor;
import static jdk.nashorn.internal.runtime.Source.readFully;
-
+import static jdk.nashorn.internal.runtime.Source.sourceFor;
import java.io.File;
import java.io.PrintWriter;
import java.io.StringWriter;
@@ -45,6 +44,7 @@ import org.testng.annotations.Test;
/**
* Tests to check Nashorn JS compiler - just compiler and not execution of scripts.
*/
+@SuppressWarnings("javadoc")
public class CompilerTest {
private static final boolean VERBOSE = Boolean.valueOf(System.getProperty("compilertest.verbose"));
private static final boolean TEST262 = Boolean.valueOf(System.getProperty("compilertest.test262"));
@@ -56,7 +56,7 @@ public class CompilerTest {
public boolean exclude(File file, String content);
}
- private void log(String msg) {
+ private static void log(final String msg) {
org.testng.Reporter.log(msg, true);
}
@@ -72,6 +72,7 @@ public class CompilerTest {
options.set("print.parse", true);
options.set("scripting", true);
options.set("const.as.var", true);
+ options.set("verify.code", true);
final ErrorManager errors = new ErrorManager() {
@Override
@@ -98,11 +99,16 @@ public class CompilerTest {
compileTestSet(new File(TEST262_SUITE_DIR), new TestFilter() {
@Override
public boolean exclude(final File file, final String content) {
- return content.indexOf("@negative") != -1;
+ return content != null && content.contains("@negative");
}
});
}
- compileTestSet(new File(TEST_BASIC_DIR), null);
+ compileTestSet(new File(TEST_BASIC_DIR), new TestFilter() {
+ @Override
+ public boolean exclude(final File file, final String content) {
+ return file.getName().equals("es6");
+ }
+ });
compileTestSet(new File(TEST_NODE_DIR, "node"), null);
compileTestSet(new File(TEST_NODE_DIR, "src"), null);
}
@@ -136,6 +142,9 @@ public class CompilerTest {
private int skipped;
private void compileJSDirectory(final File dir, final TestFilter filter) {
+ if (filter != null && filter.exclude(dir, null)) {
+ return;
+ }
for (final File f : dir.listFiles()) {
if (f.isDirectory()) {
compileJSDirectory(f, filter);