Skip to content

Commit a6bb92a

Browse files
committed
rewrite overwrite-input to rmake
1 parent bfc8dc8 commit a6bb92a

File tree

6 files changed

+15
-20
lines changed

6 files changed

+15
-20
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ run-make/optimization-remarks-dir-pgo/Makefile
119119
run-make/optimization-remarks-dir/Makefile
120120
run-make/output-type-permutations/Makefile
121121
run-make/override-aliased-flags/Makefile
122-
run-make/overwrite-input/Makefile
123122
run-make/panic-abort-eh_frame/Makefile
124123
run-make/pass-linker-flags-flavor/Makefile
125124
run-make/pass-linker-flags-from-dep/Makefile

tests/run-make/overwrite-input/Makefile

-7
This file was deleted.
+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
warning: ignoring --out-dir flag due to -o flag
2-
31
error: the input file "main.rs" would be overwritten by the generated executable
42

5-
error: aborting due to 1 previous error; 1 warning emitted
3+
error: aborting due to 1 previous error
64

Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
warning: ignoring --out-dir flag due to -o flag
2-
31
error: the generated executable for the input file "main.rs" conflicts with the existing directory "."
42

5-
error: aborting due to 1 previous error; 1 warning emitted
3+
error: aborting due to 1 previous error
64

tests/run-make/overwrite-input/main.stderr

-6
This file was deleted.
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// An attempt to set the output `-o` into a directory or a file we cannot write into should indeed
2+
// be an error; but not an ICE (Internal Compiler Error). This test attempts both and checks
3+
// that the standard error matches what is expected.
4+
// See https://github.com/rust-lang/rust/issues/66530
5+
6+
use run_make_support::{diff, rustc};
7+
8+
fn main() {
9+
let file_out = rustc().input("main.rs").output("main.rs").run_fail().stderr_utf8();
10+
let folder_out = rustc().input("main.rs").output(".").run_fail().stderr_utf8();
11+
diff().expected_file("file.stderr").actual_text("actual-file-stderr", file_out).run();
12+
diff().expected_file("folder.stderr").actual_text("actual-folder-stderr", folder_out).run();
13+
}

0 commit comments

Comments
 (0)