Skip to content

Commit 777e7ac

Browse files
committed
Ignore tests that touch the filesystem if sandboxed.
Adds an environment variable `CROSS_SANDBOXED` that skips tests that touch the filesystem if set.
1 parent a82b90b commit 777e7ac

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/build.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ fn main() {
2323
.unwrap()
2424
.write_all(commit_info().as_bytes())
2525
.unwrap();
26+
27+
if env::var("CROSS_SANDBOXED").is_ok() {
28+
println!("cargo:rustc-cfg=cross_sandboxed");
29+
}
30+
println!("cargo:rerun-if-env-changed=CROSS_SANDBOXED");
2631
}
2732

2833
fn commit_info() -> String {

src/docker/shared.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,6 +1059,7 @@ mod tests {
10591059
}
10601060

10611061
#[test]
1062+
#[cfg_attr(cross_sandboxed, ignore)]
10621063
fn test_host() -> Result<()> {
10631064
let vars = unset_env();
10641065
let mount_finder = MountFinder::new(vec![]);

0 commit comments

Comments
 (0)