From 5e18ef16f2ff241ec5df235ce283bfd87c4ab063 Mon Sep 17 00:00:00 2001 From: Davis Goodin Date: Thu, 5 Oct 2023 16:25:22 -0500 Subject: [PATCH] Cherry-pick CL 532816 "runtime: normalize line endings in TestGdbPython" --- ...malize-line-endings-in-TestGdbPython.patch | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 patches/0009-runtime-normalize-line-endings-in-TestGdbPython.patch diff --git a/patches/0009-runtime-normalize-line-endings-in-TestGdbPython.patch b/patches/0009-runtime-normalize-line-endings-in-TestGdbPython.patch new file mode 100644 index 00000000000..6b54374fc01 --- /dev/null +++ b/patches/0009-runtime-normalize-line-endings-in-TestGdbPython.patch @@ -0,0 +1,28 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: qmuntal +Date: Thu, 5 Oct 2023 12:02:43 +0200 +Subject: [PATCH] runtime: normalize line endings in TestGdbPython + +TestGdbPython fails on some Windows setups because the line endings in +the output of the gdb command can potentially be CRLF, but the test +expects LF. + +This CL changes the test to normalize the line endings. + +Change-Id: Iada9c37dc98249ac3c5f1edca4a657c51d4382a2 +--- + src/runtime/runtime-gdb_test.go | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/runtime/runtime-gdb_test.go b/src/runtime/runtime-gdb_test.go +index 8c759bf4066370..ced71ca4767d0f 100644 +--- a/src/runtime/runtime-gdb_test.go ++++ b/src/runtime/runtime-gdb_test.go +@@ -275,6 +275,7 @@ func testGdbPython(t *testing.T, cgo bool) { + t.Fatalf("gdb exited with error: %v", err) + } + ++ got = bytes.ReplaceAll(got, []byte("\r\n"), []byte("\n")) // normalize line endings + firstLine, _, _ := bytes.Cut(got, []byte("\n")) + if string(firstLine) != "Loading Go Runtime support." { + // This can happen when using all.bash with