7 releases

Uses new Rust 2021

0.1.6 Oct 30, 2021
0.1.5 Jun 26, 2021
0.1.4 Apr 22, 2021

#143 in Testing

Download history 1/week @ 2022-03-04 15/week @ 2022-03-11 28/week @ 2022-03-18 2/week @ 2022-04-01 1/week @ 2022-04-08 35/week @ 2022-04-29 44/week @ 2022-05-06 119/week @ 2022-05-13 23/week @ 2022-05-20 42/week @ 2022-05-27 49/week @ 2022-06-03 2/week @ 2022-06-17

93 downloads per month

GPL-3.0+

73KB
2.5K SLoC

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:

    • tap: nested TAP
    • junit or junit-flat: junit format
    • junit-nested: junit with nested testsuite elements
    • json: some unspecified json representation

Dependencies

~2.3–3.5MB
~71K SLoC