Skip to content

Commit

Permalink
add runtime_root (#69)
Browse files Browse the repository at this point in the history
* add `runtime_root`

* update libtest-with

* add runtime_group

* add `runtime_user`

* bounce version
  • Loading branch information
yanganto committed Oct 2, 2023
1 parent 2a98db4 commit 1e8bc55
Show file tree
Hide file tree
Showing 5 changed files with 246 additions and 38 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "test-with"
version = "0.10.3"
version = "0.10.4"
authors = ["Antonio Yang <[email protected]>"]
edition = "2021"
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ the test runner will treat it as the test in Rust and also provide the same summ
The `runtime` feature should be enabled and include as normal dependency, and also include the `libtest-with` with corresponding features in `Cargo.toml`.
```toml
test-with = { version = "0.10", features = ["runtime"] }
libtest-with = { version = "0.6.1-1", features = ["net", "resource", "user", "executable"] }
libtest-with = { version = "0.6.1-2", features = ["net", "resource", "user", "executable"] }
```

Create an example with the following runtime macros (`test_with::runner!`, `#[test_with::module]`, `#[test_with::runtime_env()]`).
Expand Down
2 changes: 1 addition & 1 deletion examples/runner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ edition = "2021"

[dependencies]
test-with = { path = "../../", features = ["runtime"] }
libtest-with = { version = "0.6.1-1", features = ["net", "resource", "user", "executable"]}
libtest-with = { version = "0.6.1-2", features = ["net", "resource", "user", "executable"]}
18 changes: 17 additions & 1 deletion examples/runner/examples/test.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test_with::runner!(env, file, path, net);
test_with::runner!(env, file, path, net, user);

#[test_with::module]
mod env {
Expand Down Expand Up @@ -78,3 +78,19 @@ mod net {
assert!(true);
}
}

#[test_with::module]
mod user {
#[test_with::runtime_root()]
fn test_ignored_by_normal_user() {
panic!("should be ignored")
}
#[test_with::runtime_group(avengers)]
fn test_ignored_by_normal_person() {
panic!("should be ignored")
}
#[test_with::runtime_user(spider)]
fn test_ignored_by_normal_man() {
panic!("should be ignored")
}
}
Loading

0 comments on commit 1e8bc55

Please sign in to comment.