add doc and linting for test output compare attribute

This commit is contained in:
Matthias Bernt
2022-12-09 14:08:01 +01:00
parent 4d15da60d2
commit ddc270e7d9
2 changed files with 10 additions and 4 deletions
+2 -2
View File
@@ -1594,9 +1594,9 @@ by ``file`` using the ``compare`` attribute:
- ``re_match``: each line of the history data set is compared to the regular
expression specified in the corresponding line of the ``file``. The allowed
number of non matching lines can be set with ``lines_diff`` and the history
and local dataset is sorted if ``sort`` is set to ``true``.
dataset is sorted if ``sort`` is set to ``true``.
- ``re_match_multiline``: it is checked if the history data sets matches the
multi line regular expression given in ``file``. The history and local datasets are sorted
multi line regular expression given in ``file``. The history dataset is sorted
before the comparison if the ``sort`` atrribute is set to ``true``.
- ``contains``: check if each line in ``file`` is contained in the history data set.
The allowed number of lines that are not contained in the history dataset
+8 -2
View File
@@ -1633,8 +1633,14 @@ def test_tests_expect_num_outputs_filter(lint_ctx):
def test_tests_compare_attrib_incompatibility(lint_ctx):
tool_source = get_xml_tool_source(TESTS_COMPARE_ATTRIB_INCOMPATIBILITY)
run_lint(lint_ctx, tests.lint_tsts, tool_source)
assert 'Test 1: Attribute decompress is incompatible with compare="re_match".' in lint_ctx.error_messages
assert 'Test 1: Attribute sort is incompatible with compare="contains".' in lint_ctx.error_messages
assert (
'Test 1: Attribute decompress is incompatible with compare="re_match".'
in lint_ctx.error_messages
)
assert (
'Test 1: Attribute sort is incompatible with compare="contains".'
in lint_ctx.error_messages
)
assert not lint_ctx.info_messages
assert len(lint_ctx.valid_messages) == 1
assert not lint_ctx.warn_messages