MCPcopy Create free account
hub / github.com/andreasfertig/cppinsights / runCmd

Function runCmd

tests/runTest.py:17–25  ·  view source on GitHub ↗
(cmd, data=None)

Source from the content-addressed store, hash-verified

15mypath = '.'
16
17def runCmd(cmd, data=None):
18 if input is None:
19 p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
20 stdout, stderr = p.communicate()
21 else:
22 p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
23 stdout, stderr = p.communicate(input=data)
24
25 return stdout.decode('utf-8'), stderr.decode('utf-8'), p.returncode
26#------------------------------------------------------------------------------
27
28def cleanStderr(stderr, fileName=None):

Callers 2

testCompileFunction · 0.70
mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected