Main Content

polyspace.BugFinderResults

Read Polyspace Bug Finder results from MATLAB

Description

Read Polyspace® Bug Finder™ analysis results to MATLAB® tables by using this object. You can obtain a high-level overview of results or details such as each instance of a defect.

Note

Before you run Polyspace from MATLAB, you must link your Polyspace and MATLAB installations. See Integrate Polyspace with MATLAB and Simulink or Integrate Polyspace Server Products with MATLAB.

Creation

Description

resObj = polyspace.BugFinderResults(resultsFolder) creates an object for reading a specific set of Bug Finder results into MATLAB tables. Use the object methods to read the results.

example

proj = polyspace.Project; resObj = proj.Results; creates a polyspace.Project object with a Results property. If you run a Bug Finder analysis, this property is a polyspace.BugFinderResults object.

example

Input Arguments

expand all

Name of result folder, specified as a character vector. The folder must directly contain the results file with extension .psbf. Even if the results file resides in a subfolder of the specified folder, it cannot be accessed.

If the folder is not in the current folder, resultsFolder must include a full or relative path.

Example: 'C:\Polyspace\Results\'

Object Functions

getSummaryView number of Polyspace results organized by results type (Bug Finder) or color and file (Code Prover)
getResultsView all instances of Bug Finder or Code Prover results

Examples

collapse all

This example shows how to read Bug Finder analysis results from MATLAB.

Copy a demo result set to a temporary folder.

resPath=fullfile(polyspaceroot,'polyspace','examples','cxx','Bug_Finder_Example',...
'Module_1','BF_Result');
userResPath = tempname;
copyfile(resPath,userResPath);

Create the results object.

resObj = polyspace.BugFinderResults(userResPath);

Read results to MATLAB tables using the object.

resSummary = getSummary (resObj);
resTable = getResults (resObj);

Run a Polyspace Bug Finder analysis on the demo file numerical.c. Configure these options:

  • Specify GCC 4.9 as your compiler.

  • Save the results in a results subfolder of the current working folder.

proj = polyspace.Project;

% Configure analysis
proj.Configuration.Sources = {fullfile(polyspaceroot, 'polyspace',... 
    'examples', 'cxx', 'Bug_Finder_Example', 'sources', 'numerical.c')};
proj.Configuration.TargetCompiler.Compiler = 'gnu4.9';
proj.Configuration.ResultsDir = fullfile(pwd,'results');

% Run analysis
bfStatus = run(proj, 'bugFinder');

% Read results
resObj = proj.Results;
bfSummary = getResults(resObj, 'readable');

Version History

Introduced in R2017a