6 releases (3 breaking)

0.3.1 Sep 30, 2024
0.3.0 Sep 1, 2024
0.2.1 Aug 26, 2024
0.1.0 Aug 20, 2024
0.0.0 Aug 19, 2024

#167 in Testing

Download history 335/week @ 2024-08-15 252/week @ 2024-08-22 191/week @ 2024-08-29 51/week @ 2024-09-05 98/week @ 2024-09-12 29/week @ 2024-09-19 192/week @ 2024-09-26 45/week @ 2024-10-03

366 downloads per month
Used in etest-tests

LGPL-3.0-or-later WITH LGPL-3… and GPL-3.0-or-later

28KB
430 lines

crates.io docs.rs Coverage Status Build Status

About

etest allows to control behaviour of #[test] like functions:

  • it allows to specify the maximum runtime of a test (timeout parameter)

  • it allows to skip a test based on the result of another function (skip_* parameter class)

  • it allows to limit parallel execution of tests by making it dependend on resources which are simply used ("shared" usage) or consumed for the duration of test ("exclusive" usage)

Example

#[etest(skip=is_today_monday(),
        timeout=2_000,
        consumes=["video", "audio"],
        uses=["network"])]
fn test_00() {
    do_something();
}

This test will:

  • be skipped at monday

  • will be aborted after 2 seconds

  • will use "video" and "audio" resources exclusively; e.g. there will be no other test running which uses one or both of these resources

  • will share the "network" resource; e.g. other tests which share this resource are allowed at the same time, but no tests which use it exclusively.

License

The code of the toplevel etest crate (content of src folder) is licensed under LGPL-3.0-or-later with an exception which removes restrictions regarding static linking.

Implementation details (crates in the etest-derive + etest-impl folders) are licensed under GPL-3.0-or-later with the explicit permission to use and distribute the generated code (the expanded macro) under terms of your choice.

Independent tests (etest-tests) are licensed under GPL-3.0-or-later.

Dependencies

~77KB