1 /* |
1 /* |
2 * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2003, 2017, 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. |
21 * questions. |
21 * questions. |
22 */ |
22 */ |
23 |
23 |
24 /* |
24 /* |
25 * @test |
25 * @test |
26 * @bug 4934778 4777599 6553182 8146427 8146475 |
26 * @bug 4934778 4777599 6553182 8146427 8146475 8175055 |
27 * @summary Make sure that -help, -helpfile and -nohelp options work correctly. |
27 * @summary Make sure that -help, -helpfile and -nohelp options work correctly. |
28 * @author jamieh |
28 * @author jamieh |
29 * @library ../lib |
29 * @library ../lib |
30 * @modules jdk.javadoc/jdk.javadoc.internal.tool |
30 * @modules jdk.javadoc/jdk.javadoc.internal.tool |
31 * @build JavadocTester TestHelpOption |
31 * @build JavadocTester TestHelpOption |
109 javadoc("-d", "out5", |
109 javadoc("-d", "out5", |
110 "-sourcepath", testSrc, |
110 "-sourcepath", testSrc, |
111 "-helpfile", testSrc("test-help.html"), |
111 "-helpfile", testSrc("test-help.html"), |
112 "-helpfile", testSrc("test-help.html"), |
112 "-helpfile", testSrc("test-help.html"), |
113 testSrc("Sample.java")); |
113 testSrc("Sample.java")); |
114 checkExit(Exit.ERROR); |
114 checkExit(Exit.CMDERR); |
115 } |
115 } |
116 |
116 |
117 @Test |
117 @Test |
118 void testHelpfileNohelpConflict() { |
118 void testHelpfileNohelpConflict() { |
119 javadoc("-d", "out6", |
119 javadoc("-d", "out6", |
120 "-sourcepath", testSrc, |
120 "-sourcepath", testSrc, |
121 "-helpfile", testSrc("test-help.html"), |
121 "-helpfile", testSrc("test-help.html"), |
122 "-nohelp", |
122 "-nohelp", |
123 testSrc("Sample.java")); |
123 testSrc("Sample.java")); |
124 checkExit(Exit.ERROR); |
124 checkExit(Exit.CMDERR); |
125 } |
125 } |
126 |
126 |
127 private void checkOutput(boolean withOption) { |
127 private void checkOutput(boolean withOption) { |
128 checkOutput(Output.OUT, withOption, |
128 checkOutput(Output.OUT, withOption, |
129 "-d ", |
129 "-d ", |