test-clang-import: Only run tests if clang is in PATH

This commit is contained in:
Daniel Marjamäki 2020-09-03 20:18:33 +02:00
parent 5cd92a0eb1
commit b3d7289460
1 changed files with 6 additions and 0 deletions

View File

@ -26,6 +26,12 @@ def get_debug_section(title, stdout):
def check_symbol_database(code):
# Only compare symboldatabases if clang is found in PATH
try:
subprocess.call(['clang', '--version'])
except OSError:
return
testfile = 'test.cpp'
with open(testfile, 'w+t') as f:
f.write(code)