Crates.io | ensc-testsuite |
lib.rs | ensc-testsuite |
version | 0.1.7 |
source | src |
created_at | 2021-04-06 08:18:02.943028 |
updated_at | 2024-06-23 11:16:53.330623 |
description | Tool to generate TAP or JUnit reports |
homepage | |
repository | https://gitlab-ext.sigma-chemnitz.de/ensc/ensc-testsuite.git |
max_upload_size | |
id | 379735 |
size | 108,912 |
Library for writing plans for integration and e2e tests. Results can be given
out in nested TAP,
junit
and some junit dialect which allows nested testsuite
elements.
Usage:
use ensc_testsuite::PlanRunner;
#[test]
fn test() {
let p = PlanRunner::new();
p.run("init", |p| {
p.ok("create database", || database.create());
let admin: Admin =
p.ok("create admin", || database.create_admin()).into();
p.fail("create 2nd admin", || database.create_admin());
p.eq("exactly one admin", 1, database.count_admin());
p.new_plan("some other test")
.set_skip(easter_is_at_xmas(), "strange event")
.run(|p| {
p.ok("....", || true);
});
});
// not really necessary
p.destruct();
}
When running cargo test
, two environment variables must be set:
TESTSUITE_OUTPUT
: the basename of the output file; depending on
the chosen format a suffix like .tap
or .junit
will be appended
TESTSUITE_FORMAT
: a comma separated list of output formats.
Supported values are: