Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add runtime_root #69

Merged
merged 5 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading