Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test automation #44

Closed
wants to merge 15 commits into from
Closed

Commits on Sep 4, 2020

  1. Include com.sun.tools as dependency only if Java 8

    This change causes com.sun.tools to be included as a dependency
    only if the JDK version is 1.8.
    
    Otherwise, without this change, the build fails when run under any
    Java version later than Java 8.
    sideshowbarker committed Sep 4, 2020
    Configuration menu
    Copy the full SHA
    05b9024 View commit details
    Browse the repository at this point in the history
  2. Set fork=true for Maven AntRun javac/java if Java8

    This change causes the Maven AntRun plugin to invoke the javac and java
    commands with fork=true when run in a Java 8 environment.
    
    Otherwise, without this change, the build fails when run under Java 8.
    sideshowbarker committed Sep 4, 2020
    Configuration menu
    Copy the full SHA
    a27c7b6 View commit details
    Browse the repository at this point in the history
  3. Fix TokenizerTester casing of PCDATA state name

    This change updates the TokenizerTester code to expect its input test
    data to have the string "Data state" to identify PCDATA tests — rather
    than the string "DATA state".
    
    The test data in the html5lib-tests suite uses "Data state", so without
    this change, running TokenizerTester against html5lib-tests causes
    TokenizerTester to fail with a “Broken test data” harness failure.
    sideshowbarker committed Sep 4, 2020
    Configuration menu
    Copy the full SHA
    623cea1 View commit details
    Browse the repository at this point in the history
  4. Exit 1 for test harness if any tests fail

    This change makes TokenizerTester, TreeTester, and EncodingTester exit
    with status code 1 if any test cases fail.
    
    Otherwise, without this change, we won’t catch the test failures when
    running tests under CI.
    sideshowbarker committed Sep 4, 2020
    Configuration menu
    Copy the full SHA
    d419264 View commit details
    Browse the repository at this point in the history
  5. Drop “Success” message for test passes

    This change makes TokenizerTester, TreeTester, and EncodingTester stop
    emitting the word “Success” to standard error every time a test passes.
    
    Otherwise, without this change, in test output, we end up with so many
    “Success” lines that the actual test failures are effectively obscured
    (you have to scroll back through the output/log to hunt for failures).
    sideshowbarker committed Sep 4, 2020
    Configuration menu
    Copy the full SHA
    dd7ecfa View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    ebbd0c5 View commit details
    Browse the repository at this point in the history
  7. Make HtmlInputStreamReader sniffing limit settable

    This change makes the sniffing limit in HtmlInputStreamReader settable.
    
    Without this change, the HtmlInputStreamReader sniffing limit is
    hardcoded to 1024 — and in the context of testing, that has the effect
    of limiting HtmlInputStreamReader to only being useful for testing
    expected output of the meta prescan.
    
    So this change makes it possible for HtmlInputStreamReader to also be
    used for testing the results for the state where the expected character
    encoding is not limited to what can be determined by checking the first
    1024 bytes of the input stream.
    sideshowbarker committed Sep 4, 2020
    Configuration menu
    Copy the full SHA
    10f012a View commit details
    Browse the repository at this point in the history
  8. Make EncodingTester usable in testing parsed state

    This change updates EncodingTester to make it test the result for cases
    when the expected character encoding is not limited to what can be
    determined by checking only the first 1024 bytes of the input stream.
    
    Otherwise, without this change, EncodingTester is limited to only being
    useful for testing the output of the meta prescan.
    sideshowbarker committed Sep 4, 2020
    Configuration menu
    Copy the full SHA
    e8e4a25 View commit details
    Browse the repository at this point in the history
  9. Make TokenizerTester() constructor public

    This change makes the TokenizerTester(InputStream stream) constructor
    public — as the corresponding constructors for TreeTester and
    EncodingTester already are.
    sideshowbarker committed Sep 4, 2020
    Configuration menu
    Copy the full SHA
    196bd48 View commit details
    Browse the repository at this point in the history
  10. Add Html5libTest

    anthonyvdotbe authored and sideshowbarker committed Sep 4, 2020
    Configuration menu
    Copy the full SHA
    d4edb40 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    ef95b92 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    fcd18b1 View commit details
    Browse the repository at this point in the history
  13. Make Html5libTest only check .dat and .test files

    This change refines how Html5libTest handles filenames; it adds a
    mechanism to allow a required/expected file extension to be specified
    for each test type, and uses the mechanism to specify that ".test" is
    the required/expected extension for tokenizer tests, and that ".dat" is
    the required/expected extension for tree-construction test files and for
    encoding test files.
    
    Without this change, Html5libTest only deals correctly with the ".test"
    extension for tokenizer test files — but not with the ".dat" extension
    for tree-construction test files and encoding test files.
    sideshowbarker committed Sep 4, 2020
    Configuration menu
    Copy the full SHA
    fd2c260 View commit details
    Browse the repository at this point in the history
  14. Make Html5libTest handle double-escaped tests

    This change makes Html5libTest correctly handle tests in the
    html5lib-tests suite which have cases with so-called “double-escaped”
    “input” and “output” values — for example, values that contain the
    literals “\\u0000” and “\\uFFFD" rather than “\u0000” and “\uFFFD”.
    sideshowbarker committed Sep 4, 2020
    Configuration menu
    Copy the full SHA
    8a48cb0 View commit details
    Browse the repository at this point in the history
  15. Use Paths.get rather than Path.of in Html5libTest

    This change replaces Path.of() calls in Html5libTest with Paths.get().
    
    Per https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/file/Path.html#of(java.net.URI)
    Path.of() was introduced in Java 11. So Java 8 has no Path.of(); see
    also https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html
    
    We need to continue to support Java 8 for the time being. It seems
    Paths.get() will eventually end up being formally deprecated; by the
    time it finally is, we may also be able to quit supporting Java 8 — and
    so we can just switch to Path.of() then.
    sideshowbarker committed Sep 4, 2020
    Configuration menu
    Copy the full SHA
    390d9a9 View commit details
    Browse the repository at this point in the history