cppcheck/addons/test
Richard A. Smith 2b44fb57bc Loosen restrictions on MISRA rules text structure (#2157)
Version 1.88 changed the parsing of the MISRA rules file adding a
severity setting.  This caused a regression in rule parsing.

In particular the following format used to parse cleanly and produce
rule output that would show the severity as part of the rule text.

    Rule 1.2

    Advisory

    Rule text goes here.

    Rule 1.3

    Required

    More rule text goes here.

As of 1.88 a file structured like above would parse as having no rules.

The problem is the use of blank lines as a rule delimiter.   The
modified rule parser wants to see a rules formatted like below:

    Rule 3.1 Required
    R3.1 text.
    Rule 4.1 Required
    R4.1 text.

or:

    Rule 1.1
    Add this rule and parse to next, skipping empty lines.

    Rule 1.2
    Rule text.

Any rule text that did not fall into one of the above formats would
result in incomplete rule text parsing.

Change the parsing of the rule text file so that blank lines are ignored
instead of treating them as a delimiter between rules. Instead use the
start of the next rule as a delimiter for the end of the previous rule.
This allows both of the newer formats but also supports the behavior of
pre-1.88 versions.

Change units tests that were specifically forbidding the use of blank
lines to ones that allow blank lines.
2019-09-09 21:43:44 +02:00
..
misra Loosen restrictions on MISRA rules text structure (#2157) 2019-09-09 21:43:44 +02:00
path1 Fix per file excludes (#1437) 2018-10-18 09:17:57 +02:00
y2038 Update addons structure. Make Y2038 addon works. (#2024) 2019-07-26 06:38:03 +02:00
__init__.py misra.py: Fix up and improve load rules parser. (#1895) 2019-06-17 21:17:29 +02:00
cert-test.c add support for CERT-API01-C check (#1980) 2019-07-24 10:39:31 +02:00
cert-test.cpp addons/cert.py: Add MSC30-C: Do not use rand() (#1348) 2018-08-24 15:05:50 +02:00
misc-test.cpp String concatenation in array: Improved handling of macros 2018-04-28 23:01:29 +02:00
naming_test.c addons/naming.py: Fix crash on unnamed arguments, add regex validation. (#1762) 2019-03-26 18:54:09 +01:00
namingng_test.c Added a new naming check addon. Also verifies variable and function p… (#1456) 2018-11-06 20:46:07 +01:00
test-cert.py cert.py: Refactor arguments handling (#2044) 2019-07-26 15:40:25 +02:00
test-misra.py Loosen restrictions on MISRA rules text structure (#2157) 2019-09-09 21:43:44 +02:00
test-y2038.py Update addons structure. Make Y2038 addon works. (#2024) 2019-07-26 06:38:03 +02:00
util.py Update addons structure. Make Y2038 addon works. (#2024) 2019-07-26 06:38:03 +02:00