diff options
Diffstat (limited to 'test/test.rs')
-rw-r--r-- | test/test.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/test.rs b/test/test.rs index 2cf30360..4c81aa2b 100644 --- a/test/test.rs +++ b/test/test.rs @@ -25,6 +25,7 @@ mod test_unistd; use nixtest::assert_size_of; use std::os::unix::io::RawFd; +use std::sync::Mutex; use nix::unistd::read; /// Helper function analogous to std::io::Read::read_exact, but for `RawFD`s @@ -37,6 +38,17 @@ fn read_exact(f: RawFd, buf: &mut [u8]) { } } +lazy_static! { + /// Any test that changes the process's current working directory must grab + /// this mutex + pub static ref CWD_MTX: Mutex<()> = Mutex::new(()); + /// Any test that creates child processes must grab this mutex, regardless + /// of what it does with those children. + pub static ref FORK_MTX: Mutex<()> = Mutex::new(()); + /// Any test that registers a SIGUSR2 handler must grab this mutex + pub static ref SIGUSR2_MTX: Mutex<()> = Mutex::new(()); +} + #[test] pub fn test_size_of_long() { // This test is mostly here to ensure that 32bit CI is correctly |