On 1/12/2015 1:14 PM, Tobias Burnus wrote: > Joel Sherrill wrote: >> On 1/12/2015 10:30 AM, Andreas Schwab wrote: >>> Joel Sherrill <joel.sherr...@oarcorp.com> writes: >>> >>>> FAIL: gfortran.dg/g77/f77-edit-x-out.f -Os output pattern test, is 1 2 3 >>>> 1 2 3 >>>> >>>> , should match ^1 2 3( >>>> | >>>> |)1 2 3( >>>> | >>>> |)$ >>> Where is the \r gone? The pattern has (\n|\r\n|\r). >> I am not exactly sure what you mean but when I run the test >> by itself from the command and redirect the output to a file, >> this is what the output looks like: >> >> 0000000 2031 2032 3320 0a0d 2031 2032 3320 0a0d >> 0000000 1 2 3 \r \n 1 2 3 \r \n >> 0000010 0a0d 2a2a 202a 5845 5449 6320 646f 2065 >> 0000010 \r \n * * * E X I T c o d e >> 0000020 0d30 000a >> 0000020 0 \r \n >> 0000023 >> >> It looks like we have \r\n at the end of each line. >> >> Is it possible it is not CR/LF but the EXIT code message confusing the >> pattern? > Contrary to Andreas, I do see \r in run.txt – at least when I look at > the file when saved from Thunderbird. Namely, the output is (sp = space, > nl = \n, cr = \r): > > 1 sp 2 sp sp 3 cr cr nl > 1 sp 2 sp sp 3 cr cr nl > cr cr nl > *** EXIT code 0 cr cr nl run.txt is the cut and paste of the log file which reflects DejaGNU's view of the run. I think that means we are looking at output from the verbose command invoked here in remote.exp around line 1030:
verbose -log "Executed $prog, status $status" 2 if {![string match "" $output]} { verbose -log -- "$output" 2 } > Namely: I do not see CR-NL but CR-CR-NL. That looks rather odd and does > not match what you get when you manually run the program. Looing at > other lines like "spawn sis -i ./f77-edit-x-out.exe", they have a CR-NL, > i.e. only a single CR. Thus, the question is what inserts an additional > "\r" into the output. I think it is the verbose procedure in runtest.exp. It sets "newline" to 1 and prints all messages including "Executing on host:..." with a newline. Double check me on that. > > Additionally, I think you are right that the "*** EXIT code 0" also > causes problems with the pattern. Details below but this is standard DejaGNU output when the target doesn't return an exit code. > Can you try the following: > > a) Replace the pattern by "1 2 3(\n|\r\r\n|\r)" (twice), note the > duplicated "\r" > b) Remove the "dg-output "\$" line > > [Best would be if you could try them also separately.] My bet would be > that doing (a) and (b) will succeed, while only (a) and (b) will fail. > > > If using (a) [alone or together with (b)] works, you should really find > out what inserts the "\r", especially as it does not appear if you > manually run the program. "\r\r\n" is definitely not a pattern I would > like to see in the test file. I assume the file in question is gcc/gcc/testsuite/gfortran.dg/g77/f77-edit-x-out.f (a) alone didn't make it pass. (b) alone didn't make it pass. (a) and (b) together did not make it pass Does this file get copied or something else during the process that would eliminate edits having an impact? > If (b) works [alone or together with (a)]: Any chance that you silence > the "\r\r\n*** EXIT code 0\r\r\n" output? I think it could potentially > confuse other test cases and it doesn't belong there. – I am also > inclined not to remove the '\$', unless there are very compelling > reasons to do so. The "***EXIT code ..." message is the standard DejaGNU message which is used on targets which do not directly return an exit code. This is in testglue.c in the DejaGNU installation. Look in the body of ORIG_EXIT. It is /usr/share/dejagnu/testglue.c on the computer I am here. If it is the ***EXIT line and the compare really doesn't see the \r, what would be needed to try that? Is there an easy way to take out.txt and just force it against this .exp pattern? > > Tobias -- Joel Sherrill, Ph.D. Director of Research & Development joel.sherr...@oarcorp.com On-Line Applications Research Ask me about RTEMS: a free RTOS Huntsville AL 35805 Support Available (256) 722-9985