JUnit Report in Rust
Generate JUnit compatible XML reports in Rust.
Example
use ;
use File;
// Create a successful test case
let test_success = success
.set_classname
.set_filepath
.build;
// Create a test case that encountered an unexpected error condition
let test_error = error;
// Create a test case that failed because of a test failure
let test_failure = failure;
// Next we create a test suite named "ts1" with not test cases associated
let ts1 = new;
// Then we create a second test suite called "ts2" and set an explicit time stamp
// then we add all the test cases from above
let timestamp = datetime!;
let ts2 = new
.set_timestamp
.add_testcase
.add_testcase
.add_testcase
.build;
// Last we create a report and add all test suites to it
let r = new
.add_testsuite
.add_testsuite
.build;
// The report can than be written in XML format to any writer
let mut file = create.unwrap;
r.write_xml.unwrap;