| Crates.io | proc-test-catalog |
| lib.rs | proc-test-catalog |
| version | 0.1.0 |
| created_at | 2021-12-20 07:03:18.938333+00 |
| updated_at | 2021-12-20 07:03:18.938333+00 |
| description | Proc macros for test catalog collection, see test-catalog for details |
| homepage | |
| repository | |
| max_upload_size | |
| id | 500625 |
| size | 7,808 |
It's a simple tool to collect test cases information and export as a catalog.
First, install test-catalog binary with cargo install test-catalog.
To use the test catalog specification, please add the dependencies to Cargo manifest file (Cargo.toml):
[dev-dependecies]
proc-test-catalog = "0.1.0"
test-catalog = "0.1.0"
Note that the proc-test-catalog crate needs nightly channel to compile.
After then, additional to legacy test cases, you should use #[proc_test_catalog::test_catalogue] attribute after #[test], and then add the case description in the document line.
#[test]
#[proc_test_catalog::test_catalogue(since = "0.1.0")]
/// This is preferred case description.
fn it_works() {
// some test codes.
println!("ok");
}
Full supported attributes list for test_catalogue proc macro are listed beblow:
^2.3.0 && ~2.5.0 or ">2.0".And then, apply cargo test, and export the test catalog with test-catalog tool.
Full information list about a test case is:
file.file.The test-catalog tool could export the test catalog to many file formats, including markdown, confluence wiki markup, tab-separated text(tsv), csv, or json, markdown by default.
For example, export the test catalog to CSV:
test-catalog -f csv