Prerequisites:
- The Klocwork Server package and the Klocwork Visual Studio desktop plug-in must be installed.
- The Klocwork servers must be running.
To test your Klocwork installation, you can use the sample project 'demosthenes' to quickly create and analyze a project. To set up the sample project:
-
In the <klocwork_server_install>\samples directory, you can find the Demosthenes sample project. It is a C/C++ sample project that you can use with Visual Studio.
-
From the <klocwork__server_install>\samples\demosthenes folder, run kwrun.bat. Note that if your Klocwork installation doesn't use the default server port 8080, you will need to edit the kwrun.bat file and change the server port to match your installation before you run the command.
kwrun.bat creates a directory called demosthenes_winbuild in its current working directory. kwrun.bat creates a demosthenes project on the server and analyzes each revision of the source code.
-
In your browser, enter the following URL: http://<klocwork_server_host>:<klocwork_server_port>.
-
Select Klocwork Static Code Analysis and log in. A password is not required if you have not set up authentication.
- Choose demosthenes from the project list. From the issues list, you can investigate the issues and get familiar with all of the available features found in Klocwork Static Code Analysis.
-
Next, open demosthenes in Visual Studio by opening the '4.sln' file found in the <klocwork_server_install>\samples\demosthenes\<visual studio version> folder.
-
Connect the project to your Klocwork server by right-clicking the solution in the Solution Explorer and selecting Klocwork Solution Properties. Next, select 'demosthenes' from the Klocwork Server project list and click OK.
- With continuous analysis, issues are detected when you open or save a file. Make some changes to your code and find out how issues can be dealt with on the fly.