rewrite silly-file-names to rmake

This commit is contained in:
Oneirical 2024-06-26 15:14:13 -04:00
parent 16df91b97a
commit 11ac258a5f
3 changed files with 24 additions and 13 deletions

View File

@ -162,7 +162,6 @@ run-make/sepcomp-cci-copies/Makefile
run-make/sepcomp-inlining/Makefile
run-make/sepcomp-separate/Makefile
run-make/share-generics-dylib/Makefile
run-make/silly-file-names/Makefile
run-make/simd-ffi/Makefile
run-make/split-debuginfo/Makefile
run-make/stable-symbol-names/Makefile

View File

@ -1,12 +0,0 @@
# ignore-cross-compile we need to execute the binary
# ignore-windows we create files with < and > in their names
include ../tools.mk
all:
echo '"comes from a file with a name that begins with <"' > "$(TMPDIR)/<leading-lt"
echo '"comes from a file with a name that ends with >"' > "$(TMPDIR)/trailing-gt>"
cp silly-file-names.rs "$(TMPDIR)/silly-file-names.rs"
$(RUSTC) "$(TMPDIR)/silly-file-names.rs" -o "$(TMPDIR)/silly-file-names"
"$(TMPDIR)/silly-file-names" > "$(TMPDIR)/silly-file-names.run.stdout"
$(RUSTC_TEST_OP) "$(TMPDIR)/silly-file-names.run.stdout" silly-file-names.run.stdout

View File

@ -0,0 +1,24 @@
// There used to be assert! checks in the compiler to error on encountering
// files starting or ending with < or > respectively, as a preventive measure
// against "fake" files like <anon>. However, this was not truly required,
// as rustc has other checks to verify the veracity of a file. This test includes
// some files with < and > in their names and prints out their output to stdout,
// expecting no errors.
// See https://github.com/rust-lang/rust/issues/73419
//@ ignore-cross-compile
// Reason: the compiled binary is executed
//@ ignore-windows
// Reason: Windows refuses files with < and > in their names
use run_make_support::{diff, fs_wrapper, run, rustc};
fn main() {
fs_wrapper::create_file("<leading-lt");
fs_wrapper::write("<leading-lt", r#""comes from a file with a name that begins with <""#);
fs_wrapper::create_file("trailing-gt>");
fs_wrapper::write("trailing-gt>", r#""comes from a file with a name that ends with >""#);
rustc().input("silly-file-names.rs").output("silly-file-names").run();
let out = run("silly-file-names").stdout_utf8();
diff().expected_file("silly-file-names.run.stdout").actual_text("actual-stdout", out).run();
}