Skip to content

Add color diffs to htmldocck.py #78750

Closed
@jyn514

Description

@jyn514

Currently, test failures look like this:

---- [rustdoc] rustdoc/where.rs stdout ----

error: htmldocck failed!
status: exit code: 1
command: "/usr/bin/python" "/home/joshua/rustc/src/etc/htmldocck.py" "/home/joshua/rustc/build/x86_64-unknown-linux-gnu/test/rustdoc/where" "/home/joshua/rustc/src/test/rustdoc/where.rs"
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
7: @has check failed
	`XPATH PATTERN` did not match
	// @has foo/trait.Bravo.html '//pre' "pub trait Bravo<B> where B: MyTrait"

Encountered 1 errors

This tells you what test went wrong, but not where. Why didn't the pattern match? No idea.

Instead, htmldocck could tell you exactly what went wrong:

diff

I hacked this together with some scripts, I'll see about turning it into something maintainable. Giant thank you to @Nemo157 for the help!

Originally posted by @jyn514 in #77820 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to RustA-testsuiteArea: The testsuite used to check the correctness of rustcT-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions