mirror of
https://github.com/rizsotto/scan-build.git
synced 2025-12-16 12:00:08 +01:00
25 lines
557 B
Python
25 lines
557 B
Python
#!/usr/bin/env python
|
|
|
|
import argparse
|
|
import json
|
|
import sys
|
|
import os.path
|
|
|
|
|
|
EXPECTED = frozenset(['far.cxx', 'bar.cc', 'foo.cpp', 'boo.c++'])
|
|
|
|
|
|
def main():
|
|
parser = argparse.ArgumentParser()
|
|
parser.add_argument('input', type=argparse.FileType('r'))
|
|
args = parser.parse_args()
|
|
# file is open, parse the json content
|
|
input = json.load(args.input)
|
|
# just get file names
|
|
result = set([os.path.basename(entry['file']) for entry in input])
|
|
return 0 if result == EXPECTED else 1
|
|
|
|
|
|
if __name__ == '__main__':
|
|
sys.exit(main())
|