#12254: cppcheck.cfg can't be loaded from relative paths anymore - #5780
#12254: cppcheck.cfg can't be loaded from relative paths anymore#5780olabetskyi wants to merge 14 commits into
Conversation
811da83 to
eb116f9
Compare
d7f5c61 to
ecfbb79
Compare
danmar
left a comment
There was a problem hiding this comment.
looks good. I have some nits.
|
|
||
| args.insert(0, cppcheck_exe) | ||
|
|
||
| exitcode, _, stderr = cppcheck(args) |
There was a problem hiding this comment.
stylistically I would personally tighten this:
exitcode, _, stderr = cppcheck([cppcheck_exe, '--premium=misra-c++-2008', test_file])
or at least just create args, with the exe filename as first option directly.
There was a problem hiding this comment.
it would also be interesting to check that stdout does not complain about unhandled option.
danmar
left a comment
There was a problem hiding this comment.
I just have minor nits. when those are done and CI is happy I think we can merge this.
| 'Checking {} ...'.format(test_file) | ||
| ] | ||
| lines = stdout.splitlines() | ||
| assert lines == out_lines |
There was a problem hiding this comment.
well it works but I guess you could also just write:
assert f'Checking {test_file} ...' == stdout.strip()
|
|
||
| # check the version it should be as in cfg | ||
| exitcode, stdout, stderr = cppcheck([cppcheck_exe, '--version']) | ||
| assert stdout == product_name + '\n' |
There was a problem hiding this comment.
maybe stdout.strip() == product_name would be somewhat better. So it doesn't care if there is "\r\n" in windows. or extra newlines.
|
|
||
| # should be fine now | ||
| exitcode, stdout, stderr = cppcheck([cppcheck_exe, '--premium=misra-c++-2008', test_file]) | ||
| exitcode, stdout, stderr = cppcheck(['--premium=misra-c++-2008', test_file], None, True, cppcheck_exe) |
There was a problem hiding this comment.
rather than providing all arguments explicitly it's better to write:
exitcode, stdout, stderr = cppcheck(['--premium=misra-c++-2008', test_file], cppcheck_exe=cppcheck_exe)
fix python tests