Monday, 9 January 2012

Coverity SA Control

I have been running Coverity SA on a number of SW components and remembering the parameters was getting to be a bit of a drag. I had them documented in a Word document but opening that up every time was also getting annoying, so I wrote a script to handle this. This script allows you to add the components to a configuration script rather than on the command line and also helps unattended analysis (i.e. during nightly builds).

The script has a few key 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 (I would suggest to add a check for successful build, though).

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"

No comments:

Post a Comment