addons/namingng.py: Documentation and standalone unit test.#5841
addons/namingng.py: Documentation and standalone unit test.#5841mvds00 wants to merge 7 commits into
Conversation
|
|
||
|  | ||
|
|
||
| ### Using namingng.py |
There was a problem hiding this comment.
Just feedback on the struct and not he contents.
I guess this could be restructured into a "description", "configuration" and "usage" sub-section.
The invocation should be moved into a separate generic section as it applies to all addons.
There was a problem hiding this comment.
Good point, will change.
| expect.sort() | ||
| assert lines == expect | ||
|
|
||
| # Perform same analysis again, but now in standalone mode. |
There was a problem hiding this comment.
We should probably move all the standalone addon tests from being a non-portable, inline command-line script to Python.
I also think we should move the addon tests to a separate script. That is probably true for several things in test-other.py which is basically just a dumping ground for most non-project tests.
Both is nothing for this PR but for future cleanups.
There was a problem hiding this comment.
Both is nothing for this PR but for future cleanups.
Fine with me to do this while I'm at it...
There was a problem hiding this comment.
I force pushed a split of test-other.py into test-addons.py on this PR.
With a little help from my artificially intelligent friend. Note that literal _ needs escaping in markdown format.
This reuses the existing unit test, running the addon on the dump file created. The format of the standalone mode is different so the expected output is slightly transformed before checking. This implicitly also tests `cppcheck --dump`, i.e. whether checking 1 file leads to 1 dump file, and whether the dump filename is indeed file+'.dump'. This is relevant as some code simply assumes this to be the case.
|
This PR will become part of #5852 |
As promised:
I decided, for now, to skip the request for an additional unit test for namingng config without function/variable prefixes. All configuration options of namingng.py are optional, so it feels arbitrary to add a test only for the absence of this particular setting. If we can come up with a clear strategy for such testing and decide it adds tangible value, then I'd be happy to implement it - let's discuss.