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

Function run

tools/bisect/bisect_hang.py:8–28  ·  view source on GitHub ↗
(cppcheck_path, options, elapsed_time=None)

Source from the content-addressed store, hash-verified

6
7# TODO: detect missing file
8def run(cppcheck_path, options, elapsed_time=None):
9 timeout = None
10 if elapsed_time:
11 timeout = elapsed_time * 2
12 cmd = options.split()
13 cmd.insert(0, cppcheck_path)
14 print('running {}'.format(cppcheck_path))
15 with subprocess.Popen(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) as p:
16 try:
17 p.communicate(timeout=timeout)
18 if p.returncode != 0:
19 print('error')
20 return None
21 print('done')
22 except subprocess.TimeoutExpired:
23 print('timeout')
24 p.kill()
25 p.communicate()
26 return False
27
28 return True
29
30
31# TODO: check arguments

Callers 1

bisect_hang.pyFile · 0.70

Calls 1

formatMethod · 0.80

Tested by

no test coverage detected