dejagnu
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Tweak pass/fail lines for dg-output tests


From: Richard Sandiford
Subject: Tweak pass/fail lines for dg-output tests
Date: Sat, 07 Dec 2013 12:10:41 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

At the moment a failing dg-output test is printed as:

    fail "$name output pattern test, is ${output}, should match $texttmp"

and a passing one is printed as:

    pass "$name output pattern test, $texttmp"

This means that a failing test causes the entire program output to be dumped
to the .sum file and to the terminal.  It's then harder to compare FAILs
from different runs if the output can vary from run to run (e.g. because
it uses random numbers or because address randomisation is turned on).

The regexp itself can contain newlines so the pass message can also span
several lines.

This patch turns the pass/fail line into a simple "$name output pattern test"
and prints the expected and actual output to the log, in a similar way to
excess errors tests.

FWIW the motivating example was a FAIL like:

FAIL: c-c++-common/asan/global-overflow-1.c  -Os  output pattern test, is ==4731
==ERROR: AddressSanitizer failed to allocate 0xdfff0001000 (15392894357504) byte
s at address 0x02008fff7000 (12)
==4731==ReserveShadowMemoryRange failed while trying to map 0xdfff0001000 bytes.
 Perhaps you're using ulimit -v
, should match READ of size 1 at 0x[0-9a-f]+ thread T0.*(
|
)    #0 0x[0-9a-f]+ (in _*main ([^
]*global-overflow-1.c:20|[^
]*:0)|[(])[^
]*(
|
).*0x[0-9a-f]+ is located 0 bytes to the right of global variable.*YYY[^
]* of size 10[^
]*(
|
)

in a testsuite run on GCC trunk.

Tested using GCC.

Thanks,
Richard

Attachment: dg-output.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]