* Update addons structure. Make Y2038 addon works.
All addons are now located in same directory, where cppcheck-gui is
looking for them.
Y2038 addon has been updated to latest cppcheck version. Output is same
as 303622f01c01ca5acdac2504f2dab442b5343cab commit as it described in
README: 303622f01c/addons/y2038/README
.
* Clean up .travis.yml
* Update travis.yml paths.
* misra.py: Bring back -P argument for backward compatibility
* Fix paths
* Normalize dumpfile paths tpo cppcheck format
* Fixup 3 test.
* Add arguments regression test.
* Fixing travis build
29 lines
846 B
Python
29 lines
846 B
Python
# Helpers for pytest tests
|
|
import subprocess
|
|
import json
|
|
|
|
def dump_create(fpath, *argv):
|
|
cmd = ["./cppcheck", "--dump", "--quiet", fpath] + list(argv)
|
|
p = subprocess.Popen(cmd)
|
|
p.communicate()
|
|
if p.returncode != 0:
|
|
raise OSError("cppcheck returns error code: %d" % p.returncode)
|
|
subprocess.Popen(["sync"])
|
|
|
|
|
|
def dump_remove(fpath):
|
|
subprocess.Popen(["rm", "-f", fpath + ".dump"])
|
|
|
|
|
|
def convert_json_output(raw_json_strings):
|
|
"""Convert raw stdout/stderr cppcheck JSON output to python dict."""
|
|
json_output = {}
|
|
for line in raw_json_strings:
|
|
try:
|
|
json_line = json.loads(line)
|
|
# json_output[json_line['errorId']] = json_line
|
|
json_output.setdefault(json_line['errorId'], []).append(json_line)
|
|
except ValueError:
|
|
pass
|
|
return json_output
|