Joel Sherrill wrote:
run.txt is the cut and paste of the log file which reflects DejaGNU's view of the run.
Which means that it hopefully matches every bit of the original output and that no editor interferes by adding or removing line breaks.


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.

Good to know. If the pattern is known, one can add it to the pattern.


  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

Yes.

(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?

I don't think so. Too bad that it didn't seem to help.

Is there an easy way to take out.txt and just force it against this .exp pattern?

Well, you could try whether PERL is able to match it, i.e. something like "cat file | perl ..." if you manage to get the exact output into a file (esp. with the right number of \r and \n, including the last line). I don't know whether that's really identical but it should come close to how DejaGNU matches the pattern.

Example - I use printf instead of a file:

printf '1 2  3\n1 2  3\n\n*** EXIT code 0' \
| perl -e '$in = join("", <STDIN>); if ($in =~ m/^1 2 3(\n|\r\n|\r)1 2 3(\n|\r\n|\r)((\n|\r\n|\r)\*\*\* EXIT code 0)?$/s) { print "matched\n" } else { print "not matched\n" };'

Tobias

Reply via email to