-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Open
Labels
A-doctestsArea: Documentation tests, run by rustdocArea: Documentation tests, run by rustdocA-libtestArea: `#[test]` / the `test` libraryArea: `#[test]` / the `test` libraryC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Description
Originally filed at rust-lang/cargo#6927
When running cargo test
on a project with some doc tests I see the following output:
$ cargo test
Finished dev [unoptimized + debuginfo] target(s) in 0.06s
Running target/debug/deps/tq_parser-9edae091aa940c1c
running 1 test
test tokenizer::tests::string_literal::simple ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
Doc-tests tq-parser
running 3 tests
test src/tokenizer.rs - tokenizer::Tokenizer<'text>::new (line 158) ... ok
test src/tokenizer.rs - tokenizer::Tokenizer (line 36) ... ok
test src/tokenizer.rs - tokenizer::Token (line 122) ... ok
test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
This ticket is focusing on this portion:
Doc-tests tq-parser
running 3 tests
test src/tokenizer.rs - tokenizer::Tokenizer<'text>::new (line 158) ... ok
test src/tokenizer.rs - tokenizer::Tokenizer (line 36) ... ok
test src/tokenizer.rs - tokenizer::Token (line 122) ... ok
I believe this output could be more useful, perhaps at the cost of being 'pretty', if the line numbers were joined to the source file path with a :
to produce a clickable (in some environments) path.
For example, if the output were the following
Doc-tests tq-parser
running 3 tests
test src/tokenizer.rs:158 - tokenizer::Tokenizer<'text>::new ... ok
test src/tokenizer.rs:36 - tokenizer::Tokenizer ... ok
test src/tokenizer.rs:122 - tokenizer::Token ... ok
I could cmd-click on src/tokenizer.rs:158
and be taken, in my editor, directly to the doc test instead of having to open the file then navigate to the line.
This is more useful in the case of errors.
If I change the tokenizer::Tokenizer<'text>::new
test to fail I get
test src/tokenizer.rs - tokenizer::Tokenizer<'text>::new (line 158) ... FAILED
Which could be
test src/tokenizer.rs:158 - tokenizer::Tokenizer<'text>::new ... FAILED
Metadata
Metadata
Assignees
Labels
A-doctestsArea: Documentation tests, run by rustdocArea: Documentation tests, run by rustdocA-libtestArea: `#[test]` / the `test` libraryArea: `#[test]` / the `test` libraryC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Type
Projects
Status
No status