From c51828ae8b31bda26b0d19637aad75f871d661ba Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Sat, 6 Jan 2024 18:46:25 +0300 Subject: [PATCH] tests: Normalize `\r\n` to `\n` in some run-make tests The output is produced by printf from C code in these cases, and printf prints in text mode, which means `\n` will be printed as `\r\n` on Windows. In --bless mode the new output with `\r\n` will replace expected output in `tests/run-make/raw-dylib-*\output.txt` files, which use \n, always resulting in dirty files in the repo. --- tests/run-make/raw-dylib-c/Makefile | 2 +- tests/run-make/raw-dylib-inline-cross-dylib/Makefile | 2 +- tests/run-make/raw-dylib-link-ordinal/Makefile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/run-make/raw-dylib-c/Makefile b/tests/run-make/raw-dylib-c/Makefile index 06e7935c026..af5c4a6edd7 100644 --- a/tests/run-make/raw-dylib-c/Makefile +++ b/tests/run-make/raw-dylib-c/Makefile @@ -17,7 +17,7 @@ else $(CC) "$(TMPDIR)"/extern_1.obj -shared -o "$(TMPDIR)"/extern_1.dll $(CC) "$(TMPDIR)"/extern_2.obj -shared -o "$(TMPDIR)"/extern_2.dll endif - "$(TMPDIR)"/driver > "$(TMPDIR)"/output.txt + "$(TMPDIR)"/driver | tr -d '\r' > "$(TMPDIR)"/output.txt "$(TMPDIR)"/raw_dylib_test_bin > "$(TMPDIR)"/output_bin.txt ifdef RUSTC_BLESS_TEST diff --git a/tests/run-make/raw-dylib-inline-cross-dylib/Makefile b/tests/run-make/raw-dylib-inline-cross-dylib/Makefile index 195b5fda56f..6b44b40e253 100644 --- a/tests/run-make/raw-dylib-inline-cross-dylib/Makefile +++ b/tests/run-make/raw-dylib-inline-cross-dylib/Makefile @@ -26,5 +26,5 @@ else $(CC) "$(TMPDIR)"/extern_1.obj -shared -o "$(TMPDIR)"/extern_1.dll $(CC) "$(TMPDIR)"/extern_2.obj -shared -o "$(TMPDIR)"/extern_2.dll endif - $(call RUN,driver) > "$(TMPDIR)"/output.txt + $(call RUN,driver) | tr -d '\r' > "$(TMPDIR)"/output.txt $(RUSTC_TEST_OP) "$(TMPDIR)"/output.txt output.txt diff --git a/tests/run-make/raw-dylib-link-ordinal/Makefile b/tests/run-make/raw-dylib-link-ordinal/Makefile index 49e959cdb5b..3cf1300c243 100644 --- a/tests/run-make/raw-dylib-link-ordinal/Makefile +++ b/tests/run-make/raw-dylib-link-ordinal/Makefile @@ -13,5 +13,5 @@ ifdef IS_MSVC else $(CC) "$(TMPDIR)"/exporter.obj exporter.def -shared -o "$(TMPDIR)"/exporter.dll endif - "$(TMPDIR)"/driver > "$(TMPDIR)"/output.txt + "$(TMPDIR)"/driver | tr -d '\r' > "$(TMPDIR)"/output.txt $(RUSTC_TEST_OP) "$(TMPDIR)"/output.txt output.txt