Running the sample script

The sample script provides a working example of how to start the code review application from the Linux or Windows command line.

About this task

The sample script gathers code review parameters from the command line, starts the code review application with those values, and writes the output from the application to an output file. The script provides a level of error handling by checking for required parameters and displaying an error message when one is missing.

The version of the sample script appropriate for your operating system is in the bin subdirectory of the product installation directory:
  • For Linux: install/bin/codereviewbatch.sh
  • For Windows: install\bin\codereviewbatch.bat
In these examples, install is the product installation directory.

For the syntax of the script start command and the contents of the Linux and Windows sample scripts, see the related topics.

Procedure

To run the sample script:

  1. Export rule information from the software analysis configuration window to create a rule file.
  2. Set up directories, data files, and source code files to use as parameter values.
  3. Open a command console. On Linux, set the DISPLAY environment variable to a valid X server and display number.
  4. Run the script by entering a command on a single line. The following command shows an example of how to start the sample script:
    codereviewbatch 
         -workspace c:\ws\workspace_0001  
         -rulefile c:\rf\rule_file.dat 
         -exportdir c:\cobol_export_file
         -directory c:\source_code  
         -includefile c:\rf\include_file
         -outputfile c:\tm\output_information
         -debug

Feedback