(cppcheck_parameters: str)
| 57 | |
| 58 | |
| 59 | def compare_ast_symdb(cppcheck_parameters: str): |
| 60 | same = True |
| 61 | debug1 = run_cppcheck(cppcheck_parameters, '') |
| 62 | debug2 = run_cppcheck(cppcheck_parameters, '--clang') |
| 63 | |
| 64 | ast1 = get_ast(debug1) |
| 65 | ast2 = get_ast(debug2) |
| 66 | if ast1 != ast2: |
| 67 | print("ast is not the same: {}".format(cppcheck_parameters)) |
| 68 | with open('cppcheck.ast', 'wt') as f: |
| 69 | f.write(ast1) |
| 70 | with open('clang.ast', 'wt') as f: |
| 71 | f.write(ast2) |
| 72 | same = False |
| 73 | |
| 74 | symdb1 = get_symdb(debug1) |
| 75 | symdb2 = get_symdb(debug2) |
| 76 | if symdb1 != symdb2: |
| 77 | print("symdb is not the same: {}".format(cppcheck_parameters)) |
| 78 | with open('cppcheck.symdb', 'wt') as f: |
| 79 | f.write(symdb1) |
| 80 | with open('clang.symdb', 'wt') as f: |
| 81 | f.write(symdb2) |
| 82 | same = False |
| 83 | |
| 84 | if not same: |
| 85 | sys.exit(1) |
| 86 | |
| 87 | for arg in sys.argv[1:]: |
| 88 | print(arg) |
no test coverage detected