perf testsuite: Add common output checking helpers
authorVeronika Molnarova <vmolnaro@redhat.com>
Thu, 15 Feb 2024 11:02:29 +0000 (12:02 +0100)
committerNamhyung Kim <namhyung@kernel.org>
Fri, 16 Feb 2024 19:49:36 +0000 (11:49 -0800)
commit61d348f1e96fe11ba7d3714bcc700d8fd71aa17e
tree1a345ee842cbd17a45732cebf835410cfb854525
parentc8eb2a9ff8b30957d90c941cb4f0caac705ceffb
perf testsuite: Add common output checking helpers

As a form of validation, it is a common practice to check the outputs
of commands whether they contain expected patterns or match a certain
regex.

Add helpers for verifying that all regexes are found in the output, that
all lines match any pattern from a set and that a certain expression is
not present in the output.

In verbose mode these helpers log mismatches for easier failure
investigation.

Signed-off-by: Veronika Molnarova <vmolnaro@redhat.com>
Signed-off-by: Michael Petlan <mpetlan@redhat.com>
Cc: kjain@linux.ibm.com
Cc: atrajeev@linux.vnet.ibm.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20240215110231.15385-6-mpetlan@redhat.com
tools/perf/tests/shell/common/check_all_lines_matched.pl [new file with mode: 0755]
tools/perf/tests/shell/common/check_all_patterns_found.pl [new file with mode: 0755]
tools/perf/tests/shell/common/check_no_patterns_found.pl [new file with mode: 0755]