Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a9f8f7d

Browse files
committedMay 31, 2024·
rewrite suspicious-library in rmake
1 parent d553d5b commit a9f8f7d

File tree

6 files changed

+28
-19
lines changed

6 files changed

+28
-19
lines changed
 

‎src/tools/compiletest/src/header.rs

+1
Original file line numberDiff line numberDiff line change
@@ -798,6 +798,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
798798
"ignore-none",
799799
"ignore-nto",
800800
"ignore-nvptx64",
801+
"ignore-nvptx64-nvidia-cuda",
801802
"ignore-openbsd",
802803
"ignore-pass",
803804
"ignore-remote",

‎src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@ run-make/static-pie/Makefile
246246
run-make/staticlib-blank-lib/Makefile
247247
run-make/staticlib-dylib-linkage/Makefile
248248
run-make/std-core-cycle/Makefile
249-
run-make/suspicious-library/Makefile
250249
run-make/symbol-mangling-hashed/Makefile
251250
run-make/symbol-visibility/Makefile
252251
run-make/symbols-include-type-name/Makefile

‎tests/run-make/incr-prev-body-beyond-eof/rmake.rs

+11-9
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,28 @@
77
// was hashed by rustc in addition to the span length, and the fix still
88
// works.
99

10-
// FIXME: Ignore flags temporarily disabled for the test.
11-
// ignore-none
12-
// ignore-nvptx64-nvidia-cuda
10+
//@ ignore-none
11+
// reason: no-std is not supported
12+
13+
//@ ignore-nvptx64-nvidia-cuda
14+
// FIXME: can't find crate for `std`
1315

1416
use run_make_support::{rustc, target, tmp_dir};
1517
use std::fs;
1618

1719
fn main() {
18-
fs::create_dir(tmp_dir().join("src"));
19-
fs::create_dir(tmp_dir().join("incr"));
20-
fs::copy("a.rs", tmp_dir().join("main.rs"));
20+
fs::create_dir(tmp_dir().join("src")).unwrap();
21+
fs::create_dir(tmp_dir().join("incr")).unwrap();
22+
fs::copy("a.rs", tmp_dir().join("src/main.rs")).unwrap();
2123
rustc()
2224
.incremental(tmp_dir().join("incr"))
2325
.input(tmp_dir().join("src/main.rs"))
24-
.target(target())
26+
.target(&target())
2527
.run();
26-
fs::copy("b.rs", tmp_dir().join("main.rs"));
28+
fs::copy("b.rs", tmp_dir().join("src/main.rs")).unwrap();
2729
rustc()
2830
.incremental(tmp_dir().join("incr"))
2931
.input(tmp_dir().join("src/main.rs"))
30-
.target(target())
32+
.target(&target())
3133
.run();
3234
}

‎tests/run-make/resolve-rename/rmake.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use std::fs;
1010
fn main() {
1111
rustc().extra_filename("-hash").input("foo.rs").run();
1212
rustc().input("bar.rs").run();
13-
fs::rename(tmp_dir().join("libfoo-hash.rlib"), tmp_dir().join("libfoo-another-hash.rlib"));
13+
fs::rename(tmp_dir().join("libfoo-hash.rlib"), tmp_dir().join("libfoo-another-hash.rlib"))
14+
.unwrap();
1415
rustc().input("baz.rs").run();
1516
}

‎tests/run-make/suspicious-library/Makefile

-8
This file was deleted.
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// This test creates some fake dynamic libraries with nothing inside,
2+
// and checks if rustc avoids them and successfully compiles as a result.
3+
4+
//@ ignore-cross-compile
5+
6+
use run_make_support::{dynamic_lib, rustc};
7+
use std::fs::File;
8+
9+
fn main() {
10+
rustc().input("foo.rs").arg("-Cprefer-dynamic").run();
11+
File::create(dynamic_lib("foo-something-special")).unwrap();
12+
File::create(dynamic_lib("foo-something-special2")).unwrap();
13+
rustc().input("bar.rs").run();
14+
}

0 commit comments

Comments
 (0)
Please sign in to comment.