Doctests have a slightly different output compared to what "protocol: rust" supports: running 2 tests test ../doctest1.rs - my_func (line 7) ... ignored test ../doctest1.rs - (line 3) ... ok test result: ok. 1 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.12s Add a little more parsing in order to accept this; a simple minded split() fails to unpack the tuple. I plan to contribute an extension of the rust module to invoke doctests, for now this allows running rustdoc --test with "protocol: 'rust'" and get information about the subtests: ▶ 4/8 ../doctest1.rs:my_func:7 SKIP ▶ 4/8 ../doctest1.rs:3 OK 4/8 rust_unit_tests:doctests / rust doctest OK 0.28s 1 subtests passed Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>pull/13983/head
parent
f9f69d835e
commit
2fd0dacf06
3 changed files with 36 additions and 2 deletions
@ -0,0 +1,12 @@ |
||||
//! This is a doctest
|
||||
//!
|
||||
//! ```
|
||||
//! assert_eq!(2+2, 4)
|
||||
//! ```
|
||||
|
||||
/// ```ignore
|
||||
/// this one will be skipped
|
||||
/// ```
|
||||
fn my_func() |
||||
{ |
||||
} |
Loading…
Reference in new issue