mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 03:58:21 +00:00
8359083: Test jdkCheckHtml.java should report SkippedException rather than report fails when miss tidy
Reviewed-by: hannesw
This commit is contained in:
parent
7b7136b4ec
commit
3e0ef832cc
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -140,6 +140,9 @@ public class DocCheck extends TestRunner {
|
|||||||
var baseDir = DOCS_DIR.resolve(DIR);
|
var baseDir = DOCS_DIR.resolve(DIR);
|
||||||
fileTester.processFiles(baseDir);
|
fileTester.processFiles(baseDir);
|
||||||
files = fileTester.getFiles();
|
files = fileTester.getFiles();
|
||||||
|
if (html) {
|
||||||
|
new TidyChecker();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<FileChecker> getCheckers() {
|
public List<FileChecker> getCheckers() {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -26,6 +26,6 @@
|
|||||||
* @bug 8337109
|
* @bug 8337109
|
||||||
* @summary Check the html in the generated documentation
|
* @summary Check the html in the generated documentation
|
||||||
* @library /test/langtools/tools/lib ../../doccheck /test/lib ../../../../tools/tester
|
* @library /test/langtools/tools/lib ../../doccheck /test/lib ../../../../tools/tester
|
||||||
* @build DocTester toolbox.TestRunner
|
* @build DocTester toolbox.TestRunner jtreg.SkippedException
|
||||||
* @run main/othervm -Ddoccheck.checks=html DocCheck
|
* @run main/othervm -Ddoccheck.checks=html DocCheck
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -38,6 +38,7 @@ import java.util.regex.Matcher;
|
|||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
import jtreg.SkippedException;
|
||||||
|
|
||||||
public class TidyChecker implements FileChecker, AutoCloseable {
|
public class TidyChecker implements FileChecker, AutoCloseable {
|
||||||
private final Path TIDY;
|
private final Path TIDY;
|
||||||
@ -164,8 +165,7 @@ public class TidyChecker implements FileChecker, AutoCloseable {
|
|||||||
if (p.isPresent()) {
|
if (p.isPresent()) {
|
||||||
tidyExePath = p.get();
|
tidyExePath = p.get();
|
||||||
} else {
|
} else {
|
||||||
System.err.println("tidy not found on PATH");
|
throw new jtreg.SkippedException("tidy not found on PATH");
|
||||||
return Path.of("tidy"); //non-null placeholder return; exception would be better
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user