MCPcopy Create free account
hub / github.com/ElementsProject/elements / call_security_check

Function call_security_check

contrib/devtools/test-security-check.py:31–43  ·  view source on GitHub ↗
(cc, source, executable, options)

Source from the content-addressed store, hash-verified

29 os.remove(executable)
30
31def call_security_check(cc, source, executable, options):
32 # This should behave the same as AC_TRY_LINK, so arrange well-known flags
33 # in the same order as autoconf would.
34 #
35 # See the definitions for ac_link in autoconf's lib/autoconf/c.m4 file for
36 # reference.
37 env_flags: List[str] = []
38 for var in ['CFLAGS', 'CPPFLAGS', 'LDFLAGS']:
39 env_flags += filter(None, os.environ.get(var, '').split(' '))
40
41 subprocess.run([*cc,source,'-o',executable] + env_flags + options, check=True)
42 p = subprocess.run(['./contrib/devtools/security-check.py',executable], stdout=subprocess.PIPE, universal_newlines=True)
43 return (p.returncode, p.stdout.rstrip())
44
45def get_arch(cc, source, executable):
46 subprocess.run([*cc, source, '-o', executable], check=True)

Callers 3

test_ELFMethod · 0.85
test_PEMethod · 0.85
test_MACHOMethod · 0.85

Calls 2

getMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected