Use new utility functions/methods in run-make tests

This commit is contained in:
Guillaume Gomez 2024-05-14 13:39:40 +02:00
parent d25cf6fc14
commit f97d915173
3 changed files with 6 additions and 12 deletions

View file

@ -26,8 +26,7 @@ fn main() {
.arg("--test") .arg("--test")
.arg("--persist-doctests") .arg("--persist-doctests")
.arg(out_dir) .arg(out_dir)
.arg("--extern") .extern_("t", extern_path)
.arg(format!("t={}", extern_path.display()))
.run(); .run();
check_generated_binaries(); check_generated_binaries();
}); });
@ -38,8 +37,7 @@ fn main() {
.arg("--test") .arg("--test")
.arg("--persist-doctests") .arg("--persist-doctests")
.arg(out_dir) .arg(out_dir)
.arg("--extern") .extern_("t", extern_path)
.arg(format!("t={}", extern_path.display()))
.arg("--no-run") .arg("--no-run")
.run(); .run();
check_generated_binaries(); check_generated_binaries();
@ -59,8 +57,7 @@ fn main() {
.arg("doctests") .arg("doctests")
.arg("--test-run-directory") .arg("--test-run-directory")
.arg(run_dir) .arg(run_dir)
.arg("--extern") .extern_("t", "libt.rlib")
.arg("t=libt.rlib")
.run(); .run();
remove_dir_all(run_dir_path); remove_dir_all(run_dir_path);

View file

@ -29,8 +29,7 @@ fn main() {
.arg(run_dir_name) .arg(run_dir_name)
.arg("--runtool") .arg("--runtool")
.arg(&run_tool_binary) .arg(&run_tool_binary)
.arg("--extern") .extern_("t", "libt.rlib")
.arg("t=libt.rlib")
.current_dir(tmp_dir()) .current_dir(tmp_dir())
.run(); .run();

View file

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