test: convert version_check ui test to run-make
else it breaks with `rpath=false`. Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
13
tests/run-make/version-check/rmake.rs
Normal file
13
tests/run-make/version-check/rmake.rs
Normal file
@@ -0,0 +1,13 @@
|
||||
use run_make_support::bare_rustc;
|
||||
|
||||
fn main() {
|
||||
let signalled_version = "Ceci n'est pas une rustc";
|
||||
let rustc_out = bare_rustc()
|
||||
.env("RUSTC_OVERRIDE_VERSION_STRING", signalled_version)
|
||||
.arg("--version")
|
||||
.run()
|
||||
.stdout_utf8();
|
||||
|
||||
let version = rustc_out.strip_prefix("rustc ").unwrap().trim_end();
|
||||
assert_eq!(version, signalled_version);
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
//@ run-pass
|
||||
//@ only-linux
|
||||
//@ only-x86
|
||||
// FIXME: this should be more like //@ needs-subprocesses
|
||||
use std::process::Command;
|
||||
|
||||
fn main() {
|
||||
let signalled_version = "Ceci n'est pas une rustc";
|
||||
let version = Command::new(std::env::var_os("RUSTC").unwrap())
|
||||
.env("RUSTC_OVERRIDE_VERSION_STRING", signalled_version)
|
||||
.arg("--version")
|
||||
.output()
|
||||
.unwrap()
|
||||
.stdout;
|
||||
let version = std::str::from_utf8(&version).unwrap().strip_prefix("rustc ").unwrap().trim_end();
|
||||
assert_eq!(version, signalled_version);
|
||||
}
|
||||
Reference in New Issue
Block a user