Skip to content

Commit

Permalink
Update docs for mod-level functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
palfrey committed Dec 30, 2023
1 parent e029883 commit ff2890d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ For cases like doctests and integration tests where the tests are run as separat
similar properties but based off file locking. Note that there are no guarantees about one test with `serial` and another with
`file_serial` as they lock using different methods.

All of the attributes can also be applied at a `mod` level and will be automagically applied to all test functions in that block.

## Usage
The minimum supported Rust version here is 1.68.2. Note this is minimum _supported_, as it may well compile with lower versions, but they're not supported at all. Upgrades to this will require at a major version bump. 1.x supports 1.51 if you need a lower version than that.

Expand Down
17 changes: 17 additions & 0 deletions serial_test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,23 @@
//! }
//! ````
//!
//! All of the attributes can also be applied at a `mod` level and will be automagically applied to all test functions in that block
//! ````
//! #[cfg(test)]
//! #[serial]
//! mod serial_attr_tests {
//! fn foo() {
//! // Won't have `serial` applied, because not a test function
//! println!("Nothing");
//! }
//!
//! #[test]
//! fn test_bar() {
//! // Will be run serially
//! }
//!}
//! ````
//!
//! ## Feature flags
#![cfg_attr(
feature = "docsrs",
Expand Down

0 comments on commit ff2890d

Please sign in to comment.