| 330 | |
| 331 | |
| 332 | def test_checkers_report(tmpdir): |
| 333 | filename = os.path.join(tmpdir, '1.txt') |
| 334 | args = [ |
| 335 | f'--checkers-report={filename}', |
| 336 | '--no-cppcheck-build-dir', # TODO: remove this |
| 337 | 'helloworld' |
| 338 | ] |
| 339 | |
| 340 | cppcheck(args, cwd=__script_dir) |
| 341 | |
| 342 | with open(filename, 'rt') as f: |
| 343 | data = f.read().splitlines() |
| 344 | assert 'No CheckAutoVariables::assignFunctionArg require:style,warning' in data, json.dumps(data, indent=4) |
| 345 | assert 'Yes CheckAutoVariables::autoVariables' in data, json.dumps(data, indent=4) |
| 346 | |
| 347 | args += [ |
| 348 | '--enable=style' |
| 349 | ] |
| 350 | cppcheck(args, cwd=__script_dir) |
| 351 | with open(filename, 'rt') as f: |
| 352 | data = f.read().splitlines() |
| 353 | # checker has been activated by --enable=style |
| 354 | assert 'Yes CheckAutoVariables::assignFunctionArg' in data, json.dumps(data, indent=4) |
| 355 | |
| 356 | |
| 357 | def test_missing_include_system(): # #11283 |