File: lock.rs

package info (click to toggle)
rust-test-with 0.15.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 512 kB
  • sloc: makefile: 2
file content (30 lines) | stat: -rw-r--r-- 770 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
fn main() {}

#[cfg(test)]
mod tests {
    // `LOCK` is file based lock to prevent test1 an test2 run at the same time
    #[test_with::lock(LOCK)]
    fn test_1() {
        assert!(true);
    }

    // `LOCK` is file based lock to prevent test1 an test2 run at the same time
    #[test_with::lock(LOCK)]
    fn test_2() {
        assert!(true);
    }

    // `ANOTHER_LOCK` is file based lock to prevent test3 an test4 run at the same time with 3 sec
    // waiting time.
    #[test_with::lock(ANOTHER_LOCK, 3)]
    fn test_3() {
        assert!(true);
    }

    // `ANOTHER_LOCK` is file based lock to prevent test3 an test4 run at the same time with 3 sec
    // waiting time.
    #[test_with::lock(ANOTHER_LOCK, 3)]
    fn test_4() {
        assert!(true);
    }
}