Choose the Polyspace installation folder to be used in this project, as defined on the Configure System page.
You can then use Polyspace commands such as polyspace-configure
, polyspace-bug-finder-server
and polyspace-code-prover-server
directly in scripts without specifying the installation folder.
You can also use the helper utility ps_helper
in scripts in the Build section of this project to filter results, report a pass/fail status and obtain other project information. For instance, in a Shell script, use the utility with the syntax $ps_helper
. In a Windows batch file, use the syntax %ps_helper%
. In the syntax descriptions below, report
refers to the results file obtained using the command polyspace-access -export
or polyspace-report-generator -generate-results-list-file
.
$ps_helper -report-filter report filtered_report [owner] [title1 value1] [title2 value2] ...
Filters report
for results with title1
set to value1
, etc. and saves to filtered_report
(with name suffix _owner
). The name owner is added to a list of owners for personalized e-mail notification later.
For instance:
$ps_helper -report-filter Results_List.tsv Results_Users.tsv userA Group Programming Function "get()"
Results_List.tsv
for results with Group
set to Programming
and Function
set to get()
.Results_Users_userA.tsv
. You can later use the base name Results_Users
to e-mail filtered reports to multiple users as a post-build action. For instance, you can send file Results_Users_userA.tsv
to userA@emailExtension.com
, file Results_Users_userB.tsv
to userB@emailExtension.com
, etc.$ps_helper -report-count-findings report
Stores the number of findings in report
(original or filtered).
For instance:
NB_FINDINGS_USERA=$($ps_helper -report-count-findings Results_Users_userA.tsv)
Returns the number of findings in Results_Users_userA.tsv
to the variable NB_FINDINGS_USERA
.
$ps_helper -report-status report max
Prints an analysis status based on number of findings in report
. If the number is greater than max
, the build status is UNSTABLE
.
Otherwise, the status is SUCCESS
.
For instance:
BUILD_STATUS=$($ps_helper -report-status Results_All.tsv 10)
Returns UNSTABLE
to BUILD_STATUS
if the number of findings in Results_All.tsv
is greater than 10.
$ps_helper -print-runid upload_out
$ps_helper -print-projectid upload_out
$ps_helper -print-projecturl upload_out
Obtains a project id, run id and project URL in Polyspace Access for the current upload. The file upload_out
is obtained when uploading a result with the command:
polyspace-access -o upload_out -upload ...
For instance:
PROJECT_ID=$($ps_helper -print-projectid upload_out)
Returns the ID of the project for the current upload to PROJECT_ID
.
PROJECT_URL=$($ps_helper -print-projecturl upload_out $POLYSPACE_ACCESS_URL)
Returns the URL of the project for the current upload to PROJECT_URL
. The variable $POLYSPACE_ACCESS_URL
represents the URL of the Polyspace Access interface (created from specified server settings).
You can use the helper utility only when no Jenkins slave is used as the helper libraries are part of the Polyspace Jenkins plugin.