Total Complexity | 2 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | #!/usr/bin/env python |
||
2 | # -*- coding: utf-8 -*- |
||
3 | # |
||
4 | # iutest_incg_test.py |
||
5 | # |
||
6 | # Copyright (C) 2016, Takazumi Shirayanagi |
||
7 | # This software is released under the new BSD License, |
||
8 | # see LICENSE |
||
9 | # |
||
10 | |||
11 | import os |
||
12 | import sys |
||
13 | import re |
||
14 | import codecs |
||
15 | |||
16 | |||
17 | def main(): |
||
18 | filepath = sys.argv[1] |
||
19 | incg = os.path.basename(filepath).upper().replace('.', '_') |
||
20 | f = codecs.open(filepath, 'r', 'utf-8-sig') |
||
21 | text = f.read() |
||
22 | f.close() |
||
23 | r = '\s*#\s*ifndef[/\s]*INCG_IRIS_{0}\S*\s*'.format(incg) |
||
24 | if not re.search(r, text): |
||
25 | exit(1) |
||
26 | |||
27 | |||
28 | if __name__ == '__main__': |
||
29 | main() |
||
30 |