[Patch] Fix output pattern checking issue

Yvan Roux <[email protected]>
Newsgroups gmane.comp.sysutils.dejagnu.general
Message-ID <CAD57uCd5hXHVcxkPFF4-SrwcdjuoDeqzvmZY3V4c3OES_divUw@mail.gmail.com>
Hi,

there is an issue when remote testing testcases which check an output
pattern with an explicit '\n' at the end.  rsh_exec explicitly removes
it to behave as 'exec', I don't know if something changed in 'exec'
behavior since these lines were checked in in 2001 or if it still
removes a '\n' in some configs, but there is a mismatch between
native, where these kind of tests are ok, and remote, where they fail.

I've tested the attached patch with GCC testsuite, and a bunch of
false output pattern failures now pass (167 sanitizer related tests in
GCC, 139 in G++ and 120 tests in fortran).

Cheers,
Yvan

2016-03-04  Yvan Roux  <[email protected]>

        * lib/rsh.exp (rsh_exec):  Don't modify command output.

_______________________________________________
DejaGnu mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/dejagnu
dj-fix-output-pattern.diff (text/plain, 495 B)
diff --git a/lib/rsh.exp b/lib/rsh.exp
index 0e3eb07..93d5f83 100644
--- a/lib/rsh.exp
+++ b/lib/rsh.exp
@@ -282,8 +282,5 @@ proc rsh_exec { boardname program pargs inp outp } {
 	return [list -1 "Couldn't parse $RSH output, $output."]
     }
     regsub "XYZ(\[0-9\]*)ZYX\n?" $output "" output
-    # Delete one trailing \n because that is what `exec' will do and we want
-    # to behave identical to it.
-    regsub "\n$" $output "" output
     return [list [expr {$status != 0}] $output]
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.