MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / run

Function run

tools/bisect/bisect_res.py:7–23  ·  view source on GitHub ↗
(cppcheck_path, options)

Source from the content-addressed store, hash-verified

5
6# TODO: detect missing file
7def run(cppcheck_path, options):
8 cmd = options.split()
9 cmd.insert(0, cppcheck_path)
10 print('running {}'.format(cppcheck_path))
11 with subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) as p:
12 stdout, stderr = p.communicate()
13 rc = p.returncode
14 # only 0 and 1 are well-defined in this case
15 if rc > 1:
16 print('error')
17 return None, None, None
18 # signals are reported as negative exitcode (e.g. SIGSEGV -> -11)
19 if rc < 0:
20 print('crash')
21 return rc, stderr, stdout
22 print('done')
23 return rc, stderr, stdout
24
25
26# TODO: check arguments

Callers 3

bisect_res.pyFile · 0.70
runMethod · 0.50
runTestsMethod · 0.50

Calls 1

formatMethod · 0.80

Tested by

no test coverage detected