Skip to content

Commit 77779c3

Browse files
committed
script: Improve test-{security,symbol}-check.py robustness
This change allows to use the `test-{security,symbol}-check.py` scripts when building out of source tree with no need to link scripts into the build directory.
1 parent 2a7c998 commit 77779c3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

contrib/devtools/test-security-check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def call_security_check(cc, source, executable, options):
3939
env_flags += filter(None, os.environ.get(var, '').split(' '))
4040

4141
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)
42+
p = subprocess.run([os.path.join(os.path.dirname(__file__), 'security-check.py'), executable], stdout=subprocess.PIPE, universal_newlines=True)
4343
return (p.returncode, p.stdout.rstrip())
4444

4545
def get_arch(cc, source, executable):

contrib/devtools/test-symbol-check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def call_symbol_check(cc: List[str], source, executable, options):
2323
env_flags += filter(None, os.environ.get(var, '').split(' '))
2424

2525
subprocess.run([*cc,source,'-o',executable] + env_flags + options, check=True)
26-
p = subprocess.run(['./contrib/devtools/symbol-check.py',executable], stdout=subprocess.PIPE, universal_newlines=True)
26+
p = subprocess.run([os.path.join(os.path.dirname(__file__), 'symbol-check.py'), executable], stdout=subprocess.PIPE, universal_newlines=True)
2727
os.remove(source)
2828
os.remove(executable)
2929
return (p.returncode, p.stdout.rstrip())

0 commit comments

Comments
 (0)