[PATCH] D16200: Add --force-analyze-debug-code option to scan-build to force debug build and hopefully enable more precise warnings.

Laszlo Nagy via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 21 19:01:50 PST 2016


rizsotto.mailinglist added a comment.

> > $ PATH=$(pwd)/bin:$PATH python -m unittest -v

> 

> 

> I don't think so:


the command i gave to you works fine on my environment. would be curious to know what OS/python do you use to have the differences. anyway, to run python unittest see more on this link https://docs.python.org/2/library/unittest.html

> leaving me puzzled about what exactly needs to be tested.

> 

> As for adding the unit test, is there currently a way to analyze C file and verify that output contains particular analyzer warning? I haven't found anything like this in tests/.


i would make this method do only the release flag filtering. (maybe call the method something like that too. eg.: `debug_compile_flags`) and call it only if the `force_analyze_debug_code` was set. this way you have a method you can test easy. pass some input flags, and check are they as expected.... `assertEquals(['-Dkey=value'], debug_compile_flags(['-Dkey=value', '-DNDEBUG']))`. or you can extend the `create_commands` method with special cases.

minor comments: you should extend the `required` decorator with `force_analyze_debug_code` on `create_commands` method... please call the `new_args` as `result` which is more descriptive... please add documentation to this new method...

thanks


Repository:
  rL LLVM

http://reviews.llvm.org/D16200





More information about the llvm-commits mailing list