Skip to content

Commit 3e0ef83

Browse files
author
SendaoYan
committed
8359083: Test jdkCheckHtml.java should report SkippedException rather than report fails when miss tidy
Reviewed-by: hannesw
1 parent 7b7136b commit 3e0ef83

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

test/docs/jdk/javadoc/doccheck/DocCheck.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -140,6 +140,9 @@ public void init() {
140140
var baseDir = DOCS_DIR.resolve(DIR);
141141
fileTester.processFiles(baseDir);
142142
files = fileTester.getFiles();
143+
if (html) {
144+
new TidyChecker();
145+
}
143146
}
144147

145148
public List<FileChecker> getCheckers() {

test/docs/jdk/javadoc/doccheck/checks/jdkCheckHtml.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,6 @@
2626
* @bug 8337109
2727
* @summary Check the html in the generated documentation
2828
* @library /test/langtools/tools/lib ../../doccheck /test/lib ../../../../tools/tester
29-
* @build DocTester toolbox.TestRunner
29+
* @build DocTester toolbox.TestRunner jtreg.SkippedException
3030
* @run main/othervm -Ddoccheck.checks=html DocCheck
3131
*/

test/docs/jdk/javadoc/doccheck/doccheckutils/checkers/TidyChecker.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -38,6 +38,7 @@
3838
import java.util.regex.Pattern;
3939
import java.util.stream.Collectors;
4040
import java.util.stream.Stream;
41+
import jtreg.SkippedException;
4142

4243
public class TidyChecker implements FileChecker, AutoCloseable {
4344
private final Path TIDY;
@@ -164,8 +165,7 @@ private Path initTidy() {
164165
if (p.isPresent()) {
165166
tidyExePath = p.get();
166167
} else {
167-
System.err.println("tidy not found on PATH");
168-
return Path.of("tidy"); //non-null placeholder return; exception would be better
168+
throw new jtreg.SkippedException("tidy not found on PATH");
169169
}
170170
}
171171

0 commit comments

Comments
 (0)