Static Analysis on isolated module (c-file)
Hello,
I have an interest in simply open a module (c-file) into parasoft and executing one of the built-in Static Analysis sets, for example "Example Configurations". Is there any way to do this without creating a full build project and assigning a build system (CDT, microsoft, gcc, etc.) The module is part of a larger project but I only want to run this single file in isolation. I don't need to compile it or build it, just run Static Analysis on it.
Thanks,
Comments
-
Hi @sketkar,
C/C++test will still require your build information to run static analysis no matter what the size of your testing scope is. In short, we use the preprocessed file to run static analysis. We will need information from your build system so we can invoke the compiler to preprocess the source file for static analysis.
You don't need to use a full project build to test one file. You can do some of the following
- Use the workspace of your original project and narrow the testing scope to only include this one file.
C++test GUI Fine Tuning:
https://docs.parasoft.com/display/CPPDESKE1042/Testing+from+the+GUI#TestingfromtheGUI-Fine-TuningTestSettingsFine-TuningTestSettings- Create a new bdf for this single source file
cpptesttrace gcc -I include Bank.cxx
- Use C++test standard edition cpptestcli to narrow down your testing scope. Below is a sample command line that can run analysis on a single file.
cpptestcli -config "builtin://Recommended Rules" -compiler gcc_7-64 -- gcc -I include Bank.cxx
C++test Standard Edition Input Scope Configuration:
https://docs.parasoft.com/display/CPPTEST1042/Command+Line+Options#CommandLineOptions-ConfiguringtheInputScope1