Skip to content

Commit 6379f9a

Browse files
Migrate run-make/crate-data-smoke to rmake.rs
1 parent c0d6003 commit 6379f9a

File tree

4 files changed

+46
-12
lines changed

4 files changed

+46
-12
lines changed

src/tools/run-make-support/src/rustc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ impl Rustc {
205205

206206
/// Get the [`Output`][::std::process::Output] of the finished process.
207207
#[track_caller]
208-
pub fn command_output(&mut self) -> ::std::process::Output {
208+
pub fn command_output(&mut self) -> Output {
209209
// let's make sure we piped all the input and outputs
210210
self.cmd.stdin(Stdio::piped());
211211
self.cmd.stdout(Stdio::piped());

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ run-make/compiler-rt-works-on-mingw/Makefile
2424
run-make/compressed-debuginfo/Makefile
2525
run-make/const-prop-lint/Makefile
2626
run-make/const_fn_mir/Makefile
27-
run-make/crate-data-smoke/Makefile
2827
run-make/crate-hash-rustc-version/Makefile
2928
run-make/crate-name-priority/Makefile
3029
run-make/cross-lang-lto-clang/Makefile

tests/run-make/crate-data-smoke/Makefile

-10
This file was deleted.
+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Tests that const prop lints interrupting codegen don't leave `.o` files around.
2+
3+
use std::process::Output;
4+
5+
use run_make_support::{bin_name, rust_lib, rustc};
6+
7+
fn compare_stdout<S: AsRef<str>>(output: Output, expected: S) {
8+
assert_eq!(
9+
String::from_utf8(output.stdout).unwrap().trim(),
10+
expected.as_ref()
11+
);
12+
}
13+
14+
fn main() {
15+
compare_stdout(rustc().print("crate-name").input("crate.rs").run(), "foo");
16+
compare_stdout(
17+
rustc().print("file-names").input("crate.rs").run(),
18+
bin_name("foo"),
19+
);
20+
compare_stdout(
21+
rustc()
22+
.print("file-names")
23+
.crate_type("lib")
24+
.arg("--test")
25+
.input("crate.rs")
26+
.run(),
27+
bin_name("foo"),
28+
);
29+
compare_stdout(
30+
rustc()
31+
.print("file-names")
32+
.arg("--test")
33+
.input("lib.rs")
34+
.run(),
35+
bin_name("mylib"),
36+
);
37+
compare_stdout(
38+
rustc().print("file-names").input("lib.rs").run(),
39+
rust_lib("mylib").file_name().unwrap().to_string_lossy(),
40+
);
41+
compare_stdout(
42+
rustc().print("file-names").input("rlib.rs").run(),
43+
rust_lib("mylib").file_name().unwrap().to_string_lossy(),
44+
);
45+
}

0 commit comments

Comments
 (0)