Skip to content

Commit

Permalink
Update tests/run-make/doctests-keep-binaries-2024/rmake.rs test to …
Browse files Browse the repository at this point in the history
…new run-make API
  • Loading branch information
GuillaumeGomez committed Aug 7, 2024
1 parent 80d4ccc commit 1a256bf
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions tests/run-make/doctests-keep-binaries-2024/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@

use std::path::Path;

use run_make_support::fs_wrapper::{create_dir, remove_dir_all};
use run_make_support::{run, rustc, rustdoc};
use run_make_support::{rfs, run, rustc, rustdoc};

fn setup_test_env<F: FnOnce(&Path, &Path)>(callback: F) {
let out_dir = Path::new("doctests");
create_dir(&out_dir);
rfs::create_dir(&out_dir);
rustc().input("t.rs").crate_type("rlib").run();
callback(&out_dir, Path::new("libt.rlib"));
remove_dir_all(out_dir);
rfs::remove_dir_all(out_dir);
}

fn check_generated_binaries() {
Expand Down Expand Up @@ -47,7 +46,7 @@ fn main() {
// Behavior with --test-run-directory with relative paths.
setup_test_env(|_, _| {
let run_dir_path = Path::new("rundir");
create_dir(&run_dir_path);
rfs::create_dir(&run_dir_path);

rustdoc()
.input("t.rs")
Expand All @@ -61,6 +60,6 @@ fn main() {
.edition("2024")
.run();

remove_dir_all(run_dir_path);
rfs::remove_dir_all(run_dir_path);
});
}

0 comments on commit 1a256bf

Please sign in to comment.