mirror of
https://github.com/xorgy/mediafire-fuse
synced 2026-01-13 13:14:29 -08:00
add test with iwyu and fix all headers accordingly
This commit is contained in:
21
tests/iwyu.py
Executable file
21
tests/iwyu.py
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import json
|
||||
import subprocess
|
||||
|
||||
with open("compile_commands.json", "r") as f:
|
||||
tunits = json.load(f)
|
||||
|
||||
result = 0
|
||||
for tu in tunits:
|
||||
_,rest = tu["command"].split(" ",1)
|
||||
# iwyu does not distinguish between different outcomes of its check
|
||||
# so instead, we grep its stderr output
|
||||
# see http://code.google.com/p/include-what-you-use/issues/detail?id=157
|
||||
ret = subprocess.call("%s %s 2>&1 | grep \"has correct #\""%("iwyu", rest), shell=True)
|
||||
if ret != 0:
|
||||
result += 1
|
||||
|
||||
exit(result)
|
||||
Reference in New Issue
Block a user