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
31
32
33
34
35
36
37
38
39
fn main() {}
#[cfg(test)]
mod tests {
// `pwd` executable command exists
#[test_with::executable(pwd)]
#[test]
fn test_executable() {
assert!(true);
}
// `/bin/sh` executable exists
#[test_with::executable(/bin/sh)]
#[test]
fn test_executable_with_path() {
assert!(true);
}
// `non` does not exist
#[test_with::executable(non)]
#[test]
fn test_non_existing_executable() {
panic!("should be ignored")
}
// `pwd` and `ls` exist
#[test_with::executable(pwd, ls)]
#[test]
fn test_executables_too() {
assert!(true);
}
// `non` or `ls` exist
#[test_with::executable(non || ls)]
#[test]
fn test_one_of_executables_exist() {
assert!(true);
}
}