use rfs
in rustdoc io rmake test
This commit is contained in:
parent
f4cb0de44e
commit
dcd6170c89
1 changed files with 5 additions and 7 deletions
|
@ -14,22 +14,20 @@
|
||||||
// `mkfs.ext4 -d`, as well as mounting a loop device for the rootfs.
|
// `mkfs.ext4 -d`, as well as mounting a loop device for the rootfs.
|
||||||
//@ ignore-windows - the `set_readonly` functions doesn't work on folders.
|
//@ ignore-windows - the `set_readonly` functions doesn't work on folders.
|
||||||
|
|
||||||
use std::fs;
|
use run_make_support::{path, rfs, rustdoc};
|
||||||
|
|
||||||
use run_make_support::{path, rustdoc};
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let out_dir = path("rustdoc-io-error");
|
let out_dir = path("rustdoc-io-error");
|
||||||
fs::create_dir(&out_dir).unwrap();
|
rfs::create_dir(&out_dir);
|
||||||
let mut permissions = fs::metadata(&out_dir).unwrap().permissions();
|
let mut permissions = rfs::metadata(&out_dir).permissions();
|
||||||
let original_permissions = permissions.clone();
|
let original_permissions = permissions.clone();
|
||||||
|
|
||||||
permissions.set_readonly(true);
|
permissions.set_readonly(true);
|
||||||
fs::set_permissions(&out_dir, permissions).unwrap();
|
rfs::set_permissions(&out_dir, permissions);
|
||||||
|
|
||||||
let output = rustdoc().input("foo.rs").output(&out_dir).env("RUST_BACKTRACE", "1").run_fail();
|
let output = rustdoc().input("foo.rs").output(&out_dir).env("RUST_BACKTRACE", "1").run_fail();
|
||||||
|
|
||||||
fs::set_permissions(&out_dir, original_permissions).unwrap();
|
rfs::set_permissions(&out_dir, original_permissions);
|
||||||
|
|
||||||
output
|
output
|
||||||
.assert_exit_code(1)
|
.assert_exit_code(1)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue