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

doc-test: In Markdown tests, Use all of <h1> to <h6> as the test name #44867

Merged
merged 1 commit into from
Oct 15, 2017

Conversation

kennytm
Copy link
Member

@kennytm kennytm commented Sep 26, 2017

This mainly simplifies debugging error index tests, as the error codes are <h2>s in the huge document containing all codes.

@rust-highfive
Copy link
Collaborator

r? @frewsxcv

(rust_highfive has picked a reviewer for you, use r? to override)

@kennytm
Copy link
Member Author

kennytm commented Sep 26, 2017

The rationale is to avoid useless CI output like #44480 (comment).

The errors now look like:

...

---- $DIR/test/error-index.md - Rust_Compiler_Error_Index::E0626 (line 11733) stdout ----
	error[E0514]: found crate `std` compiled by an incompatible version of rustc
  |
  = help: please recompile that crate using this compiler (rustc 1.22.0-dev)
  = note: crate `std` path #1: $DIR/stage0-sysroot/lib/rustlib/x86_64-apple-darwin/lib/libstd_unicode-0dc809f4018b643d.rlib compiled by "rustc 1.21.0-beta.1 (198109911 2017-08-29)"
  = note: crate `std` path #2: $DIR/stage0-sysroot/lib/rustlib/x86_64-apple-darwin/lib/libstd-202599072911ceaa.rlib compiled by "rustc 1.21.0-beta.1 (198109911 2017-08-29)"
  = note: crate `std` path #3: $DIR/stage0-sysroot/lib/rustlib/x86_64-apple-darwin/lib/libstd-202599072911ceaa.dylib compiled by "rustc 1.21.0-beta.1 (198109911 2017-08-29)"

error: aborting due to previous error

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:525:8
thread 'rustc' panicked at 'couldn't compile the test', src/librustdoc/test.rs:281:12


failures:
    $DIR/test/error-index.md - Rust_Compiler_Error_Index::E0001::_::Note__this_error_code_is_no_longer_emitted_by_the_compiler_ (line 15)
    $DIR/test/error-index.md - Rust_Compiler_Error_Index::E0002::_::Note__this_error_code_is_no_longer_emitted_by_the_compiler_ (line 42)
    $DIR/test/error-index.md - Rust_Compiler_Error_Index::E0003::_::Note__this_error_code_is_no_longer_emitted_by_the_compiler_ (line 86)
    $DIR/test/error-index.md - Rust_Compiler_Error_Index::E0004 (line 103)
    $DIR/test/error-index.md - Rust_Compiler_Error_Index::E0004 (line 123)
    $DIR/test/error-index.md - Rust_Compiler_Error_Index::E0005 (line 150)
    $DIR/test/error-index.md - Rust_Compiler_Error_Index::E0005 (line 160)

...

I've conflated the current_header field into the names field since they now serve the same purpose. Also I've removed the cnt field since it is not read anywhere.

@arielb1 arielb1 added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 26, 2017
@GuillaumeGomez
Copy link
Member

It's a bit ugly from my point of view. :-/

@kennytm
Copy link
Member Author

kennytm commented Sep 27, 2017

What if we truncate to <h2>?

@carols10cents
Copy link
Member

review reminder ping @GuillaumeGomez @QuietMisdreavus !

@QuietMisdreavus
Copy link
Member

Okay yeah, i'm a little out of my depth as to what's exactly going on here, i'm going to let imperio take over.

r? @GuillaumeGomez

@QuietMisdreavus QuietMisdreavus removed their assignment Oct 2, 2017
@GuillaumeGomez
Copy link
Member

I appreciate the fact that you removed the cnt but I have difficulties to understand the rest. Can you provide a bit more explanations (and a comparison of the current output vs the new one) please?

…name.

This mainly simplifies debugging error index tests, as the error codes are
`<h2>`s in the huge document containing all codes.
@kennytm kennytm force-pushed the rustdoc-md-test-title branch from a4e1850 to 0cdf587 Compare October 7, 2017 16:49
@kennytm
Copy link
Member Author

kennytm commented Oct 7, 2017

@GuillaumeGomez Added comments to explain the changed role of self.names and the action in register_header().

The "after" is shown in #44867 (comment). The "before" is like:

...

---- $DIR/test/error-index.md - Rust_Compiler_Error_Index (line 11733) stdout ----
	error[E0514]: found crate `std` compiled by an incompatible version of rustc
  |
  = help: please recompile that crate using this compiler (rustc 1.22.0-dev)
  = note: crate `std` path #1: $DIR/stage0-sysroot/lib/rustlib/x86_64-apple-darwin/lib/libstd_unicode-0dc809f4018b643d.rlib compiled by "rustc 1.21.0-beta.1 (198109911 2017-08-29)"
  = note: crate `std` path #2: $DIR/stage0-sysroot/lib/rustlib/x86_64-apple-darwin/lib/libstd-202599072911ceaa.rlib compiled by "rustc 1.21.0-beta.1 (198109911 2017-08-29)"
  = note: crate `std` path #3: $DIR/stage0-sysroot/lib/rustlib/x86_64-apple-darwin/lib/libstd-202599072911ceaa.dylib compiled by "rustc 1.21.0-beta.1 (198109911 2017-08-29)"

error: aborting due to previous error

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:525:8
thread 'rustc' panicked at 'couldn't compile the test', src/librustdoc/test.rs:281:12


failures:
    $DIR/test/error-index.md - Rust_Compiler_Error_Index (line 15)
    $DIR/test/error-index.md - Rust_Compiler_Error_Index (line 42)
    $DIR/test/error-index.md - Rust_Compiler_Error_Index (line 86)
    $DIR/test/error-index.md - Rust_Compiler_Error_Index (line 103)
    $DIR/test/error-index.md - Rust_Compiler_Error_Index (line 123)
    $DIR/test/error-index.md - Rust_Compiler_Error_Index (line 150)
    $DIR/test/error-index.md - Rust_Compiler_Error_Index (line 160)

...

@aidanhs
Copy link
Member

aidanhs commented Oct 12, 2017

Hi @GuillaumeGomez, have you had a chance to take another look at this?

@GuillaumeGomez
Copy link
Member

Forgot, sorry. And I still don't like it much. But if other people are interested, then it should get merged. Well anyway, please pick another reviewer, the technical side looks fine to me but I don't like the new output much. :-/

@kennytm
Copy link
Member Author

kennytm commented Oct 13, 2017

so... r? @alexcrichton ?

@GuillaumeGomez or do you have suggestions that makes the output looks nice while ensuring the markdown tests still show the <h2> in the test name?

@GuillaumeGomez
Copy link
Member

No I don't, that's why I'd like someone else review this in case they have a better idea.

@alexcrichton
Copy link
Member

@bors: r+

Looks great, thanks @kennytm!

@bors
Copy link
Contributor

bors commented Oct 14, 2017

📌 Commit 0cdf587 has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Oct 14, 2017

⌛ Testing commit 0cdf587 with merge a457e29...

bors added a commit that referenced this pull request Oct 14, 2017
doc-test: In Markdown tests, Use all of `<h1>` to `<h6>` as the test name

This mainly simplifies debugging error index tests, as the error codes are `<h2>`s in the huge document containing all codes.
@bors
Copy link
Contributor

bors commented Oct 15, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing a457e29 to master...

@bors bors merged commit 0cdf587 into rust-lang:master Oct 15, 2017
@kennytm kennytm deleted the rustdoc-md-test-title branch October 15, 2017 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants