提交 0b8e8c3b 编写于 作者: J jjg

6915497: test test/tools/javac/nio/compileTest/CompileTest.java fails under Hudson

Reviewed-by: darcy
上级 ca5da107
...@@ -23,9 +23,9 @@ ...@@ -23,9 +23,9 @@
/** /**
* @test * @test
* @bug 6906175 6915476 * @bug 6906175 6915476 6915497
* @summary Path-based JavaFileManager * @summary Path-based JavaFileManager
* @compile HelloPathWorld.java * @compile -g HelloPathWorld.java
* @run main CompileTest * @run main CompileTest
*/ */
...@@ -94,7 +94,8 @@ public class CompileTest { ...@@ -94,7 +94,8 @@ public class CompileTest {
options.addAll(Arrays.asList(opts)); options.addAll(Arrays.asList(opts));
options.addAll(Arrays.asList( options.addAll(Arrays.asList(
"-verbose", "-XDverboseCompilePolicy", "-verbose", "-XDverboseCompilePolicy",
"-d", classes.toString() "-d", classes.toString(),
"-g"
)); ));
Iterable<? extends JavaFileObject> compilationUnits = Iterable<? extends JavaFileObject> compilationUnits =
fm.getJavaFileObjects(testSrcDir.resolve(className + ".java")); fm.getJavaFileObjects(testSrcDir.resolve(className + ".java"));
...@@ -111,6 +112,8 @@ public class CompileTest { ...@@ -111,6 +112,8 @@ public class CompileTest {
File expect = new File("classes." + count + "/" + className + ".class"); File expect = new File("classes." + count + "/" + className + ".class");
if (!expect.exists()) if (!expect.exists())
throw new Exception("expected file not found: " + expect); throw new Exception("expected file not found: " + expect);
// Note that we explicitly specify -g for compiling both the actual class and the expected class.
// This isolates the expected class from javac options that might be given to jtreg.
long expectedSize = new File(testClassesDir.toString(), className + ".class").length(); long expectedSize = new File(testClassesDir.toString(), className + ".class").length();
long actualSize = expect.length(); long actualSize = expect.length();
if (expectedSize != actualSize) if (expectedSize != actualSize)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册