Re: [PATCH 0/4] Match \r\r\n in testsuite

Yao Qi
2013-09-17T13:59:15Z

On 09/17/2013 09:35 PM, Joel Brobecker wrote:
> How about we introduce a new official variable, similar to $hex,
> $decimal, etc, which would correctly match new-line output based
> on the host? I propose $eol, which is already used, but only in
> 2 testcases, so easy to adjust (remove "set eol ..." in those two
> testcases).

Yeah, that is fine to me. Considering patch 4/4, I'd like introduce two
variables, $cr and $eol, which can be defined like this,

if [istarget "*-*-mingw*"] {
set cr "\r\r"
} else {
set cr "\r"
}

set eol "${cr}\n"

In this way, patch 3/4 can be updated to something like,

- set mi_gdb_prompt "\[(\]gdb\[)\] \r\n"
+ set mi_gdb_prompt "\[(\]gdb\[)\] ${eol}"

and patch 4/4 can be updated to something like,

-gdb_test "info trace" "in gdb_recursion_test.*$srcfile:$testline2.
+gdb_test "info trace" "in gdb_recursion_test.*$srcfile:$testline2${cr}

patch 1/4/ and 2/4 can be unchanged. What do you think?

--
Yao (é½å°§)