1 Reply Latest reply: Jan 4, 2012 6:07 AM by makis RSS

CSA Controller for Linux

Coverity Ninja
Currently Being Moderated

Originally published on 2012-01-04 16:39

 

A script to help run Coverity Static Analysis written with Bash script. Script should be run from the root directory of the SW package under analysis. Package related paths are relative to this path.

This script is useful if you run many different SW packages as you can keep the configurations in one file. Spaces in names and directories should work, but of course you need to wrap this sort of strings with quotation marks.


Not really a complex script, but it has some nifty features:

 

  • - Completely configurable targets (no need to change the script),
  • - Configuration file can be defined on command-line or you can use the default,
  • - Can read login information from .smbpasswd file for unattended execution,
  • - Can select phase (build, analyze, commit) or run all three at one go.

You can get help by running the script with parameter -h.

 

The configuration file should have the following common settings:

 

# General settings 
COVERITY_BIN_DIR="/location/of/coverity/bin/dir" 
CONFIG_FILE="/location/of/coverity/config/dir/coverity_config.xml"
USER_MODEL_FILE="/location/of/user-model-file" 
ANALYSIS_OPTIONS="analysis-options-used" 
COVERITY_HOST="CIM_SERVER_ADDRESS" 
COVERITY_PORT="CIM_SERVER_PORT" 

 

 

And for each build target also the following:

 


# Target is called "TARGET" (this would be the value of the -b parameter). If no prebuild is required, leave these empty 
TARGET_PREBUILD_DIR="DIRECTORY_WHERE_PREBUILD_SCRIPT IS" 
TARGET_PREBUILD_CMD="PREBUILD COMMAND TO RUN" 
TARGET_BUILD_DIR="DIRECTORY_WHERE_BUILD_COMMAND_IS_LOCATED" 
TARGET_BUILD_CMD="BUILD_COMMAND" 
TARGET_STREAM="STREAM_NAME" 
TARGET_STRIP_PATH="PART_OF_PATH_TO_STRIP" 

 

 

 

P.S. I have named the script simply csac, but I couldn't attach a file without an extension here.

More Like This

  • Retrieving data ...