Skip to content

Commit

Permalink
test: use subprocess.run() in test-security-check.py
Browse files Browse the repository at this point in the history
  • Loading branch information
fanquake committed Jun 16, 2020
1 parent 968aaae commit 9fe71a5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions contrib/devtools/test-security-check.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ def write_testcode(filename):
''')

def call_security_check(cc, source, executable, options):
subprocess.check_call([cc,source,'-o',executable] + options)
p = subprocess.Popen(['./contrib/devtools/security-check.py',executable], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE, universal_newlines=True)
(stdout, stderr) = p.communicate()
return (p.returncode, stdout.rstrip())
subprocess.run([cc,source,'-o',executable] + options, check=True)
p = subprocess.run(['./contrib/devtools/security-check.py',executable], stdout=subprocess.PIPE, universal_newlines=True)
return (p.returncode, p.stdout.rstrip())

class TestSecurityChecks(unittest.TestCase):
def test_ELF(self):
Expand Down

0 comments on commit 9fe71a5

Please sign in to comment.