add test with iwyu and fix all headers accordingly

This commit is contained in:
josch
2014-09-20 09:40:59 +02:00
parent 4b2563d800
commit d8e00119b4
39 changed files with 152 additions and 159 deletions

21
tests/iwyu.py Executable file
View 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)