mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-09 13:33:43 +00:00
Allow fmt
to run on rmake.rs
test files
This commit is contained in:
parent
3d1062c1a4
commit
8f47f9773d
@ -13,7 +13,7 @@ ignore = [
|
|||||||
|
|
||||||
# tests for now are not formatted, as they are sometimes pretty-printing constrained
|
# tests for now are not formatted, as they are sometimes pretty-printing constrained
|
||||||
# (and generally rustfmt can move around comments in UI-testing incompatible ways)
|
# (and generally rustfmt can move around comments in UI-testing incompatible ways)
|
||||||
"/tests/",
|
"!/tests/run-make/*/rmake.rs",
|
||||||
|
|
||||||
# do not format submodules
|
# do not format submodules
|
||||||
# FIXME: sync submodule list with tidy/bootstrap/etc
|
# FIXME: sync submodule list with tidy/bootstrap/etc
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
use run_make_support::{rustc, aux_build};
|
use run_make_support::{aux_build, rustc};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
aux_build().input("stable.rs").emit("metadata").run();
|
aux_build().input("stable.rs").emit("metadata").run();
|
||||||
@ -13,11 +13,7 @@ fn main() {
|
|||||||
let mut stable_path = PathBuf::from(env!("TMPDIR"));
|
let mut stable_path = PathBuf::from(env!("TMPDIR"));
|
||||||
stable_path.push("libstable.rmeta");
|
stable_path.push("libstable.rmeta");
|
||||||
|
|
||||||
let output = rustc()
|
let output = rustc().input("main.rs").emit("metadata").extern_("stable", &stable_path).output();
|
||||||
.input("main.rs")
|
|
||||||
.emit("metadata")
|
|
||||||
.extern_("stable", &stable_path)
|
|
||||||
.output();
|
|
||||||
|
|
||||||
let stderr = String::from_utf8_lossy(&output.stderr);
|
let stderr = String::from_utf8_lossy(&output.stderr);
|
||||||
let version = include_str!(concat!(env!("S"), "/src/version"));
|
let version = include_str!(concat!(env!("S"), "/src/version"));
|
||||||
|
@ -49,22 +49,22 @@ fn main() {
|
|||||||
let bootstrap_cargo = std::env::var("BOOTSTRAP_CARGO").unwrap();
|
let bootstrap_cargo = std::env::var("BOOTSTRAP_CARGO").unwrap();
|
||||||
let mut cmd = std::process::Command::new(bootstrap_cargo);
|
let mut cmd = std::process::Command::new(bootstrap_cargo);
|
||||||
cmd.args([
|
cmd.args([
|
||||||
"build",
|
"build",
|
||||||
"--manifest-path",
|
"--manifest-path",
|
||||||
manifest_path.to_str().unwrap(),
|
manifest_path.to_str().unwrap(),
|
||||||
"-Zbuild-std=core",
|
"-Zbuild-std=core",
|
||||||
"--target",
|
"--target",
|
||||||
&target,
|
&target,
|
||||||
])
|
])
|
||||||
.env_clear()
|
.env_clear()
|
||||||
.env("PATH", path)
|
.env("PATH", path)
|
||||||
.env("RUSTC", rustc)
|
.env("RUSTC", rustc)
|
||||||
.env("RUSTFLAGS", "-Copt-level=0 -Cdebug-assertions=yes")
|
.env("RUSTFLAGS", "-Copt-level=0 -Cdebug-assertions=yes")
|
||||||
.env("CARGO_TARGET_DIR", &target_dir)
|
.env("CARGO_TARGET_DIR", &target_dir)
|
||||||
.env("RUSTC_BOOTSTRAP", "1")
|
.env("RUSTC_BOOTSTRAP", "1")
|
||||||
// Visual Studio 2022 requires that the LIB env var be set so it can
|
// Visual Studio 2022 requires that the LIB env var be set so it can
|
||||||
// find the Windows SDK.
|
// find the Windows SDK.
|
||||||
.env("LIB", std::env::var("LIB").unwrap_or_default());
|
.env("LIB", std::env::var("LIB").unwrap_or_default());
|
||||||
set_host_rpath(&mut cmd);
|
set_host_rpath(&mut cmd);
|
||||||
|
|
||||||
let status = cmd.status().unwrap();
|
let status = cmd.status().unwrap();
|
||||||
|
@ -3,17 +3,11 @@
|
|||||||
use run_make_support::{rustc, rustdoc, tmp_dir};
|
use run_make_support::{rustc, rustdoc, tmp_dir};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
rustc()
|
rustc().arg("success.rs").run();
|
||||||
.arg("success.rs")
|
|
||||||
.run();
|
|
||||||
|
|
||||||
rustc()
|
rustc().arg("--invalid-arg-foo").run_fail_assert_exit_code(1);
|
||||||
.arg("--invalid-arg-foo")
|
|
||||||
.run_fail_assert_exit_code(1);
|
|
||||||
|
|
||||||
rustc()
|
rustc().arg("compile-error.rs").run_fail_assert_exit_code(1);
|
||||||
.arg("compile-error.rs")
|
|
||||||
.run_fail_assert_exit_code(1);
|
|
||||||
|
|
||||||
rustc()
|
rustc()
|
||||||
.env("RUSTC_ICE", "0")
|
.env("RUSTC_ICE", "0")
|
||||||
@ -21,21 +15,11 @@ fn main() {
|
|||||||
.arg("compile-error.rs")
|
.arg("compile-error.rs")
|
||||||
.run_fail_assert_exit_code(101);
|
.run_fail_assert_exit_code(101);
|
||||||
|
|
||||||
rustdoc()
|
rustdoc().arg("success.rs").arg("-o").arg(tmp_dir().join("exit-code")).run();
|
||||||
.arg("success.rs")
|
|
||||||
.arg("-o")
|
|
||||||
.arg(tmp_dir().join("exit-code"))
|
|
||||||
.run();
|
|
||||||
|
|
||||||
rustdoc()
|
rustdoc().arg("--invalid-arg-foo").run_fail_assert_exit_code(1);
|
||||||
.arg("--invalid-arg-foo")
|
|
||||||
.run_fail_assert_exit_code(1);
|
|
||||||
|
|
||||||
rustdoc()
|
rustdoc().arg("compile-error.rs").run_fail_assert_exit_code(1);
|
||||||
.arg("compile-error.rs")
|
|
||||||
.run_fail_assert_exit_code(1);
|
|
||||||
|
|
||||||
rustdoc()
|
rustdoc().arg("lint-failure.rs").run_fail_assert_exit_code(1);
|
||||||
.arg("lint-failure.rs")
|
|
||||||
.run_fail_assert_exit_code(1);
|
|
||||||
}
|
}
|
||||||
|
@ -14,15 +14,11 @@
|
|||||||
|
|
||||||
use std::io::BufRead;
|
use std::io::BufRead;
|
||||||
|
|
||||||
use run_make_support::{rustc, is_msvc};
|
use run_make_support::{is_msvc, rustc};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
// build supporting crate
|
// build supporting crate
|
||||||
rustc()
|
rustc().input("bar.rs").crate_type("rlib").arg("-lbar_cli").run();
|
||||||
.input("bar.rs")
|
|
||||||
.crate_type("rlib")
|
|
||||||
.arg("-lbar_cli")
|
|
||||||
.run();
|
|
||||||
|
|
||||||
// build main crate as staticlib
|
// build main crate as staticlib
|
||||||
let output = rustc()
|
let output = rustc()
|
||||||
@ -37,7 +33,9 @@ fn main() {
|
|||||||
for l in output.stderr.lines() {
|
for l in output.stderr.lines() {
|
||||||
let l = l.expect("utf-8 string");
|
let l = l.expect("utf-8 string");
|
||||||
|
|
||||||
let Some(args) = l.strip_prefix("note: native-static-libs:") else { continue; };
|
let Some(args) = l.strip_prefix("note: native-static-libs:") else {
|
||||||
|
continue;
|
||||||
|
};
|
||||||
assert!(!found_note);
|
assert!(!found_note);
|
||||||
found_note = true;
|
found_note = true;
|
||||||
|
|
||||||
@ -53,11 +51,11 @@ fn main() {
|
|||||||
);
|
);
|
||||||
let found = $args.contains(&&*lib);
|
let found = $args.contains(&&*lib);
|
||||||
assert!(found, "unable to find lib `{}` in those linker args: {:?}", lib, $args);
|
assert!(found, "unable to find lib `{}` in those linker args: {:?}", lib, $args);
|
||||||
}}
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
assert_contains_lib!("glib-2.0" in args); // in bar.rs
|
assert_contains_lib!("glib-2.0" in args); // in bar.rs
|
||||||
assert_contains_lib!("systemd" in args); // in foo.rs
|
assert_contains_lib!("systemd" in args); // in foo.rs
|
||||||
assert_contains_lib!("bar_cli" in args);
|
assert_contains_lib!("bar_cli" in args);
|
||||||
assert_contains_lib!("foo_cli" in args);
|
assert_contains_lib!("foo_cli" in args);
|
||||||
|
|
||||||
|
@ -13,11 +13,7 @@ struct Option<'a> {
|
|||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
// Printed from CodegenBackend trait impl in rustc_codegen_llvm/src/lib.rs
|
// Printed from CodegenBackend trait impl in rustc_codegen_llvm/src/lib.rs
|
||||||
check(Option {
|
check(Option { target: &target(), option: "relocation-models", includes: &["dynamic-no-pic"] });
|
||||||
target: &target(),
|
|
||||||
option: "relocation-models",
|
|
||||||
includes: &["dynamic-no-pic"],
|
|
||||||
});
|
|
||||||
|
|
||||||
// Printed by compiler/rustc_codegen_llvm/src/llvm_util.rs
|
// Printed by compiler/rustc_codegen_llvm/src/llvm_util.rs
|
||||||
check(Option {
|
check(Option {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
//@ only-wasm32-wasip1
|
//@ only-wasm32-wasip1
|
||||||
|
|
||||||
use run_make_support::{tmp_dir, wasmparser, rustc};
|
use run_make_support::{rustc, tmp_dir, wasmparser};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
//@ only-wasm32-wasip1
|
//@ only-wasm32-wasip1
|
||||||
|
|
||||||
use run_make_support::{tmp_dir, wasmparser, rustc};
|
use run_make_support::{rustc, tmp_dir, wasmparser};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use wasmparser::ExternalKind::*;
|
use wasmparser::ExternalKind::*;
|
||||||
|
@ -1,17 +1,12 @@
|
|||||||
//@ only-wasm32-wasip1
|
//@ only-wasm32-wasip1
|
||||||
|
|
||||||
use run_make_support::{tmp_dir, wasmparser, rustc};
|
use run_make_support::{rustc, tmp_dir, wasmparser};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use wasmparser::TypeRef::Func;
|
use wasmparser::TypeRef::Func;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
rustc().input("foo.rs").target("wasm32-wasip1").run();
|
rustc().input("foo.rs").target("wasm32-wasip1").run();
|
||||||
rustc()
|
rustc().input("bar.rs").target("wasm32-wasip1").arg("-Clto").opt().run();
|
||||||
.input("bar.rs")
|
|
||||||
.target("wasm32-wasip1")
|
|
||||||
.arg("-Clto")
|
|
||||||
.opt()
|
|
||||||
.run();
|
|
||||||
|
|
||||||
let file = std::fs::read(&tmp_dir().join("bar.wasm")).unwrap();
|
let file = std::fs::read(&tmp_dir().join("bar.wasm")).unwrap();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user