Add regression test for #107495
This commit is contained in:
parent
1dea922ea6
commit
66a73f0c20
1
tests/run-make/issue-107495-archive-permissions/foo.rs
Normal file
1
tests/run-make/issue-107495-archive-permissions/foo.rs
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
22
tests/run-make/issue-107495-archive-permissions/rmake.rs
Normal file
22
tests/run-make/issue-107495-archive-permissions/rmake.rs
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
extern crate run_make_support;
|
||||||
|
|
||||||
|
use run_make_support::{aux_build, tmp_dir};
|
||||||
|
use std::fs;
|
||||||
|
#[cfg(unix)]
|
||||||
|
use std::os::unix::fs::PermissionsExt;
|
||||||
|
use std::path::Path;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
aux_build().arg("foo.rs").run();
|
||||||
|
verify(&tmp_dir().join("libfoo.rlib"));
|
||||||
|
}
|
||||||
|
|
||||||
|
fn verify(path: &Path) {
|
||||||
|
let perm = fs::metadata(path).unwrap().permissions();
|
||||||
|
|
||||||
|
assert!(!perm.readonly());
|
||||||
|
|
||||||
|
// Check that the file is readable for everyone
|
||||||
|
#[cfg(unix)]
|
||||||
|
assert_eq!(perm.mode(), 0o100664);
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user