JUnit-Parser
Rust library to parse JUnit XML files
Example
Create a
TestSuites
structure from a JUnit XML data read from reader
:
use Cursor;
let xml = r#"
<testsuite tests="3" failures="1">
<testcase classname="foo1" name="ASuccessfulTest"/>
<testcase classname="foo2" name="AnotherSuccessfulTest"/>
<testcase classname="foo3" name="AFailingTest">
<failure type="NotEnoughFoo"> details about failure </failure>
</testcase>
</testsuite>
"#;
let cursor = new;
let r = from_reader;
assert!;
let t = r.unwrap;
assert_eq!;
let ts = &t.suites;
assert_eq!;
assert_eq!;
assert_eq!;
assert!;
assert!;
Features
serde
— Enablesderive(serde::{Serialize,Deserialize})
on the Test* structures.properties_as_hashmap
(enabled by default) — Parse the properties element as a hashmapproperties_as_vector
(enabled by default) — Parse the properties element as a vector
License
This project is available under the terms of either the BSD-2-Clause license.