Skip to content

Commit 68b4795

Browse files
committed
Rid the rmake test runners from extern crate run_make_support;
1 parent 80451a4 commit 68b4795

File tree

31 files changed

+37
-123
lines changed

31 files changed

+37
-123
lines changed

tests/run-make/CURRENT_RUSTC_VERSION/rmake.rs

+2-8
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,17 @@
33
// Check that the `CURRENT_RUSTC_VERSION` placeholder is correctly replaced by the current
44
// `rustc` version and the `since` property in feature stability gating is properly respected.
55

6-
extern crate run_make_support;
7-
86
use std::path::PathBuf;
97

10-
use run_make_support::{rustc, aux_build};
8+
use run_make_support::{aux_build, rustc};
119

1210
fn main() {
1311
aux_build().input("stable.rs").emit("metadata").run();
1412

1513
let mut stable_path = PathBuf::from(env!("TMPDIR"));
1614
stable_path.push("libstable.rmeta");
1715

18-
let output = rustc()
19-
.input("main.rs")
20-
.emit("metadata")
21-
.extern_("stable", &stable_path)
22-
.output();
16+
let output = rustc().input("main.rs").emit("metadata").extern_("stable", &stable_path).output();
2317

2418
let stderr = String::from_utf8_lossy(&output.stderr);
2519
let version = include_str!(concat!(env!("S"), "/src/version"));

tests/run-make/a-b-a-linker-guard/rmake.rs

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
// Test that if we build `b` against a version of `a` that has one set of types, it will not run
44
// with a dylib that has a different set of types.
55

6-
extern crate run_make_support;
7-
86
use run_make_support::{run, run_fail, rustc};
97

108
fn main() {

tests/run-make/arguments-non-c-like-enum/rmake.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
//! Check that non-trivial `repr(C)` enum in Rust has valid C layout.
22
//@ ignore-cross-compile
33

4-
extern crate run_make_support;
5-
64
use run_make_support::{cc, extra_c_flags, extra_cxx_flags, run, rustc, static_lib};
75

86
pub fn main() {

tests/run-make/artifact-incr-cache-no-obj/rmake.rs

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
//
66
// Fixes: rust-lang/rust#123234
77

8-
extern crate run_make_support;
9-
108
use run_make_support::{rustc, tmp_dir};
119

1210
fn main() {

tests/run-make/artifact-incr-cache/rmake.rs

-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
// Also see discussion at
88
// <https://internals.rust-lang.org/t/interaction-between-incremental-compilation-and-emit/20551>
99

10-
extern crate run_make_support;
11-
1210
use run_make_support::{rustc, tmp_dir};
1311

1412
fn main() {

tests/run-make/compiler-builtins/rmake.rs

+16-18
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414

1515
#![deny(warnings)]
1616

17-
extern crate run_make_support;
18-
1917
use run_make_support::object;
2018
use run_make_support::object::read::archive::ArchiveFile;
2119
use run_make_support::object::read::Object;
@@ -51,22 +49,22 @@ fn main() {
5149
let bootstrap_cargo = std::env::var("BOOTSTRAP_CARGO").unwrap();
5250
let mut cmd = std::process::Command::new(bootstrap_cargo);
5351
cmd.args([
54-
"build",
55-
"--manifest-path",
56-
manifest_path.to_str().unwrap(),
57-
"-Zbuild-std=core",
58-
"--target",
59-
&target,
60-
])
61-
.env_clear()
62-
.env("PATH", path)
63-
.env("RUSTC", rustc)
64-
.env("RUSTFLAGS", "-Copt-level=0 -Cdebug-assertions=yes")
65-
.env("CARGO_TARGET_DIR", &target_dir)
66-
.env("RUSTC_BOOTSTRAP", "1")
67-
// Visual Studio 2022 requires that the LIB env var be set so it can
68-
// find the Windows SDK.
69-
.env("LIB", std::env::var("LIB").unwrap_or_default());
52+
"build",
53+
"--manifest-path",
54+
manifest_path.to_str().unwrap(),
55+
"-Zbuild-std=core",
56+
"--target",
57+
&target,
58+
])
59+
.env_clear()
60+
.env("PATH", path)
61+
.env("RUSTC", rustc)
62+
.env("RUSTFLAGS", "-Copt-level=0 -Cdebug-assertions=yes")
63+
.env("CARGO_TARGET_DIR", &target_dir)
64+
.env("RUSTC_BOOTSTRAP", "1")
65+
// Visual Studio 2022 requires that the LIB env var be set so it can
66+
// find the Windows SDK.
67+
.env("LIB", std::env::var("LIB").unwrap_or_default());
7068
set_host_rpath(&mut cmd);
7169

7270
let status = cmd.status().unwrap();

tests/run-make/core-no-fp-fmt-parse/rmake.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// This test checks that the core library of Rust can be compiled without enabling
22
// support for formatting and parsing floating-point numbers.
33

4-
extern crate run_make_support;
5-
64
use run_make_support::rustc;
75
use std::path::PathBuf;
86

tests/run-make/cross-lang-lto-riscv-abi/rmake.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
//! which requires extra `target-abi` metadata to be emitted.
33
//@ needs-matching-clang
44
//@ needs-llvm-components riscv
5-
extern crate run_make_support;
65

76
use run_make_support::{bin_name, clang, llvm_readobj, rustc, tmp_dir};
87
use std::{

tests/run-make/exit-code/rmake.rs

+7-25
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,25 @@
11
// Test that we exit with the correct exit code for successful / unsuccessful / ICE compilations
22

3-
extern crate run_make_support;
4-
53
use run_make_support::{rustc, rustdoc, tmp_dir};
64

75
fn main() {
8-
rustc()
9-
.arg("success.rs")
10-
.run();
6+
rustc().arg("success.rs").run();
117

12-
rustc()
13-
.arg("--invalid-arg-foo")
14-
.run_fail_assert_exit_code(1);
8+
rustc().arg("--invalid-arg-foo").run_fail_assert_exit_code(1);
159

16-
rustc()
17-
.arg("compile-error.rs")
18-
.run_fail_assert_exit_code(1);
10+
rustc().arg("compile-error.rs").run_fail_assert_exit_code(1);
1911

2012
rustc()
2113
.env("RUSTC_ICE", "0")
2214
.arg("-Ztreat-err-as-bug")
2315
.arg("compile-error.rs")
2416
.run_fail_assert_exit_code(101);
2517

26-
rustdoc()
27-
.arg("success.rs")
28-
.arg("-o")
29-
.arg(tmp_dir().join("exit-code"))
30-
.run();
18+
rustdoc().arg("success.rs").arg("-o").arg(tmp_dir().join("exit-code")).run();
3119

32-
rustdoc()
33-
.arg("--invalid-arg-foo")
34-
.run_fail_assert_exit_code(1);
20+
rustdoc().arg("--invalid-arg-foo").run_fail_assert_exit_code(1);
3521

36-
rustdoc()
37-
.arg("compile-error.rs")
38-
.run_fail_assert_exit_code(1);
22+
rustdoc().arg("compile-error.rs").run_fail_assert_exit_code(1);
3923

40-
rustdoc()
41-
.arg("lint-failure.rs")
42-
.run_fail_assert_exit_code(1);
24+
rustdoc().arg("lint-failure.rs").run_fail_assert_exit_code(1);
4325
}

tests/run-make/issue-107495-archive-permissions/rmake.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
#[cfg(unix)]
44
extern crate libc;
5-
extern crate run_make_support;
65

76
use run_make_support::{aux_build, tmp_dir};
87
use std::fs;

tests/run-make/no-input-file/rmake.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
extern crate run_make_support;
2-
31
use run_make_support::{diff, rustc};
42

53
fn main() {

tests/run-make/non-unicode-env/rmake.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
extern crate run_make_support;
2-
31
use run_make_support::rustc;
42

53
fn main() {

tests/run-make/non-unicode-in-incremental-dir/rmake.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
extern crate run_make_support;
2-
31
use run_make_support::{rustc, tmp_dir};
42

53
fn main() {

tests/run-make/print-cfg/rmake.rs

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
//!
66
//! It also checks that some targets have the correct set cfgs.
77
8-
extern crate run_make_support;
9-
108
use std::collections::HashSet;
119
use std::ffi::OsString;
1210
use std::io::BufRead;

tests/run-make/print-native-static-libs/rmake.rs

+7-11
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,13 @@
1212
//@ ignore-cross-compile
1313
//@ ignore-wasm
1414

15-
extern crate run_make_support;
16-
1715
use std::io::BufRead;
1816

19-
use run_make_support::{rustc, is_msvc};
17+
use run_make_support::{is_msvc, rustc};
2018

2119
fn main() {
2220
// build supporting crate
23-
rustc()
24-
.input("bar.rs")
25-
.crate_type("rlib")
26-
.arg("-lbar_cli")
27-
.run();
21+
rustc().input("bar.rs").crate_type("rlib").arg("-lbar_cli").run();
2822

2923
// build main crate as staticlib
3024
let output = rustc()
@@ -39,7 +33,9 @@ fn main() {
3933
for l in output.stderr.lines() {
4034
let l = l.expect("utf-8 string");
4135

42-
let Some(args) = l.strip_prefix("note: native-static-libs:") else { continue; };
36+
let Some(args) = l.strip_prefix("note: native-static-libs:") else {
37+
continue;
38+
};
4339
assert!(!found_note);
4440
found_note = true;
4541

@@ -55,11 +51,11 @@ fn main() {
5551
);
5652
let found = $args.contains(&&*lib);
5753
assert!(found, "unable to find lib `{}` in those linker args: {:?}", lib, $args);
58-
}}
54+
}};
5955
}
6056

6157
assert_contains_lib!("glib-2.0" in args); // in bar.rs
62-
assert_contains_lib!("systemd" in args); // in foo.rs
58+
assert_contains_lib!("systemd" in args); // in foo.rs
6359
assert_contains_lib!("bar_cli" in args);
6460
assert_contains_lib!("foo_cli" in args);
6561

tests/run-make/print-to-output/rmake.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
//! This checks the output of some `--print` options when
22
//! output to a file (instead of stdout)
33
4-
extern crate run_make_support;
5-
64
use std::ffi::OsString;
75

86
use run_make_support::{rustc, target, tmp_dir};
@@ -15,11 +13,7 @@ struct Option<'a> {
1513

1614
fn main() {
1715
// Printed from CodegenBackend trait impl in rustc_codegen_llvm/src/lib.rs
18-
check(Option {
19-
target: &target(),
20-
option: "relocation-models",
21-
includes: &["dynamic-no-pic"],
22-
});
16+
check(Option { target: &target(), option: "relocation-models", includes: &["dynamic-no-pic"] });
2317

2418
// Printed by compiler/rustc_codegen_llvm/src/llvm_util.rs
2519
check(Option {

tests/run-make/repr128-dwarf/rmake.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
//@ ignore-windows
22
// This test should be replaced with one in tests/debuginfo once GDB or LLDB support 128-bit enums.
33

4-
extern crate run_make_support;
5-
64
use gimli::{AttributeValue, Dwarf, EndianRcSlice, Reader, RunTimeEndian};
75
use object::{Object, ObjectSection};
86
use run_make_support::{gimli, object, rustc, tmp_dir};

tests/run-make/rust-lld-custom-target/rmake.rs

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
//@ needs-rust-lld
99
//@ only-x86_64-unknown-linux-gnu
1010

11-
extern crate run_make_support;
12-
1311
use run_make_support::regex::Regex;
1412
use run_make_support::rustc;
1513
use std::process::Output;

tests/run-make/rust-lld/rmake.rs

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
//@ ignore-msvc
66
//@ ignore-s390x lld does not yet support s390x as target
77

8-
extern crate run_make_support;
9-
108
use run_make_support::regex::Regex;
119
use run_make_support::rustc;
1210
use std::process::Output;

tests/run-make/rustdoc-test-args/rmake.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
extern crate run_make_support;
2-
31
use run_make_support::{rustdoc, tmp_dir};
42
use std::path::Path;
53
use std::{fs, iter};

tests/run-make/wasm-abi/rmake.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
//@ only-wasm32-wasip1
22
//@ needs-wasmtime
33

4-
extern crate run_make_support;
5-
64
use run_make_support::{rustc, tmp_dir};
75
use std::path::Path;
86
use std::process::Command;

tests/run-make/wasm-custom-section/rmake.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ only-wasm32-wasip1
2-
extern crate run_make_support;
32

43
use run_make_support::{rustc, tmp_dir, wasmparser};
54
use std::collections::HashMap;

tests/run-make/wasm-custom-sections-opt/rmake.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//@ only-wasm32-wasip1
2-
extern crate run_make_support;
32

4-
use run_make_support::{tmp_dir, wasmparser, rustc};
3+
use run_make_support::{rustc, tmp_dir, wasmparser};
54
use std::collections::HashMap;
65
use std::path::Path;
76

tests/run-make/wasm-export-all-symbols/rmake.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
//@ only-wasm32-wasip1
22

3-
extern crate run_make_support;
4-
5-
use run_make_support::{tmp_dir, wasmparser, rustc};
3+
use run_make_support::{rustc, tmp_dir, wasmparser};
64
use std::collections::HashMap;
75
use std::path::Path;
86
use wasmparser::ExternalKind::*;

tests/run-make/wasm-import-module/rmake.rs

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
//@ only-wasm32-wasip1
22

3-
extern crate run_make_support;
4-
5-
use run_make_support::{tmp_dir, wasmparser, rustc};
3+
use run_make_support::{rustc, tmp_dir, wasmparser};
64
use std::collections::HashMap;
75
use wasmparser::TypeRef::Func;
86

97
fn main() {
108
rustc().input("foo.rs").target("wasm32-wasip1").run();
11-
rustc()
12-
.input("bar.rs")
13-
.target("wasm32-wasip1")
14-
.arg("-Clto")
15-
.opt()
16-
.run();
9+
rustc().input("bar.rs").target("wasm32-wasip1").arg("-Clto").opt().run();
1710

1811
let file = std::fs::read(&tmp_dir().join("bar.wasm")).unwrap();
1912

tests/run-make/wasm-panic-small/rmake.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
//@ only-wasm32-wasip1
22
#![deny(warnings)]
33

4-
extern crate run_make_support;
5-
64
use run_make_support::{rustc, tmp_dir};
75

86
fn main() {

tests/run-make/wasm-spurious-import/rmake.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
//@ only-wasm32-wasip1
22

3-
extern crate run_make_support;
4-
53
use run_make_support::{rustc, tmp_dir, wasmparser};
64
use std::collections::HashMap;
75

tests/run-make/wasm-stringify-ints-small/rmake.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
//@ only-wasm32-wasip1
22
#![deny(warnings)]
33

4-
extern crate run_make_support;
5-
64
use run_make_support::{rustc, tmp_dir};
75

86
fn main() {

0 commit comments

Comments
 (0)