Skip to content

Commit

Permalink
Rollup merge of #125118 - GuillaumeGomez:cleanup-run-make, r=jieyouxu
Browse files Browse the repository at this point in the history
Use new utility functions/methods in run-make tests

Little cleanup using new functions/methods I added into the `run-make-support` library.

r? `@jieyouxu`
  • Loading branch information
compiler-errors authored May 14, 2024
2 parents d59f430 + f97d915 commit 31016d5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
9 changes: 3 additions & 6 deletions tests/run-make/doctests-keep-binaries/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ fn main() {
.arg("--test")
.arg("--persist-doctests")
.arg(out_dir)
.arg("--extern")
.arg(format!("t={}", extern_path.display()))
.extern_("t", extern_path)
.run();
check_generated_binaries();
});
Expand All @@ -38,8 +37,7 @@ fn main() {
.arg("--test")
.arg("--persist-doctests")
.arg(out_dir)
.arg("--extern")
.arg(format!("t={}", extern_path.display()))
.extern_("t", extern_path)
.arg("--no-run")
.run();
check_generated_binaries();
Expand All @@ -59,8 +57,7 @@ fn main() {
.arg("doctests")
.arg("--test-run-directory")
.arg(run_dir)
.arg("--extern")
.arg("t=libt.rlib")
.extern_("t", "libt.rlib")
.run();

remove_dir_all(run_dir_path);
Expand Down
3 changes: 1 addition & 2 deletions tests/run-make/doctests-runtool/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ fn main() {
.arg(run_dir_name)
.arg("--runtool")
.arg(&run_tool_binary)
.arg("--extern")
.arg("t=libt.rlib")
.extern_("t", "libt.rlib")
.current_dir(tmp_dir())
.run();

Expand Down
6 changes: 2 additions & 4 deletions tests/run-make/rustdoc-map-file/rmake.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use run_make_support::{rustdoc, tmp_dir};
use std::process::Command;
use run_make_support::{python_command, rustdoc, tmp_dir};

fn main() {
let out_dir = tmp_dir().join("out");
Expand All @@ -10,6 +9,5 @@ fn main() {
.output(&out_dir)
.run();
// FIXME (GuillaumeGomez): Port the python script to Rust as well.
let python = std::env::var("PYTHON").unwrap_or("python".into());
assert!(Command::new(python).arg("validate_json.py").arg(&out_dir).status().unwrap().success());
assert!(python_command().arg("validate_json.py").arg(&out_dir).status().unwrap().success());
}

0 comments on commit 31016d5

Please sign in to comment.