1 /* |
1 /* |
2 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
36 import java.util.*; |
36 import java.util.*; |
37 |
37 |
38 public class TestWithXstdout { |
38 public class TestWithXstdout { |
39 public static void main(String... args) throws Exception { |
39 public static void main(String... args) throws Exception { |
40 File testSrc = new File(System.getProperty("test.src")); |
40 File testSrc = new File(System.getProperty("test.src")); |
41 File testClasses = new File(System.getProperty("test.classes")); |
41 String testClasses = System.getProperty("test.classes", "."); |
|
42 String testClassPath = System.getProperty("test.class.path", testClasses); |
42 File stdout = new File("stdout.out"); |
43 File stdout = new File("stdout.out"); |
43 run_javac("-XDrawDiagnostics", |
44 run_javac("-XDrawDiagnostics", |
44 "-XprintProcessorInfo", |
45 "-XprintProcessorInfo", |
45 "-Werror", |
46 "-Werror", |
46 "-proc:only", |
47 "-proc:only", |
47 "-processor", "Test", |
48 "-processor", "Test", |
48 "-Xstdout", stdout.getPath(), |
49 "-Xstdout", stdout.getPath(), |
49 "-classpath", testClasses.getPath(), |
50 "-classpath", testClassPath, |
50 new File(testSrc, "Test.java").getPath()); |
51 new File(testSrc, "Test.java").getPath()); |
51 boolean ok = compare(stdout, new File(testSrc, "Test.out")); |
52 boolean ok = compare(stdout, new File(testSrc, "Test.out")); |
52 if (!ok) |
53 if (!ok) |
53 throw new Exception("differences found"); |
54 throw new Exception("differences found"); |
54 } |
55 } |