testsuite: check patterns presence or absence in output
commitf832788b65c99344761c98a75edd05dc8aca0ec3
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
Sun, 12 Feb 2017 23:28:58 +0000 (13 00:28 +0100)
committerChristopher Li <sparse@chrisli.org>
Mon, 13 Feb 2017 01:38:13 +0000 (13 09:38 +0800)
tree63a73737bdd0b53c1f0ca47adc57265fd24828f2
parentfbe84decbcabf7ff8ee93da91fa33766e1732531
testsuite: check patterns presence or absence in output

Currently the test suite always check the exit value and the output
of the command used for the test. This is fine and allow use to catch
the most common situations:
- failure or crash (via the exit value)
- (un)expected output (like when testing the result of the preprocessor)
- (un)expected errors & warnings (like when testing sparse's warnings)

But sometimes, we're not interested in the output as such because it
can't be compared textually to some reference. This occurs systematically
when testing the output of test-linearize or test-unssa which emits
labels names which are in fact pointer values and which exact output
is very sensitive to any change in processing order, optimizations, ...
But useful tests can be easily made by just checking for the presence
or absence of some identifiers, or more generally some patterns.

This patch allow to do that by adding support for two  new tags
(check-output-contains & check-output-excludes), telling to test suite
to verifiy that the given patterns are effectively present ot absent
from the output of the tested file.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: Christopher Li <sparse@chrisli.org>
Documentation/test-suite
validation/test-suite