getResults
Bug Finder または Code Prover の結果のすべてのインスタンスを表示する
説明
は、Polyspace® 結果セット resTable
= getResults(resObj
, content
)resObj
ですべての結果を示すテーブルを返します。結果セット resObj
は、polyspace.BugFinderResults
オブジェクトで示される Bug Finder の結果セットにすることも、polyspace.CodeProverResults
オブジェクトで示される Code Prover の結果セットにすることもできます。テーブルを操作して、ユーザー インターフェイスから簡単に取得できない結果についてのグラフや統計を生成できます。
例
この例では、MATLAB® から Bug Finder の解析結果を読み取る方法を示します。
デモの結果セットを一時フォルダーにコピーします。
resPath = fullfile(polyspaceroot,'polyspace','examples','cxx','Bug_Finder_Example', ... 'Module_1','BF_Result'); userResPath = tempname; copyfile(resPath,userResPath);
結果オブジェクトを作成します。
resObj = polyspace.BugFinderResults(userResPath);
このオブジェクトを使用して結果を MATLAB table に読み取ります。
resSummary = getSummary(resObj, 'defects');
resTable = getResults(resObj);
デモ ファイル numerical.c
に Polyspace Bug Finder™ 解析を実行します。以下のオプションを構成します。
コンパイラとして GCC 4.9 を指定します。
結果を現在の作業フォルダーの
results
サブフォルダーに保存します。
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 = proj.run('bugFinder'); % Read results resObj = proj.Results; bfSummary = getResults(resObj, 'readable');
この例では、MATLAB から Code Prover の解析結果を読み取る方法を示します。
デモの結果セットを一時フォルダーにコピーします。
resPath=fullfile(polyspaceroot,'polyspace','examples','cxx','Code_Prover_Example', ... 'Module_1','CP_Result'); userResPath = tempname; copyfile(resPath,userResPath);
結果オブジェクトを作成します。
resObj = polyspace.CodeProverResults(userResPath);
このオブジェクトを使用して結果を MATLAB table に読み取ります。
resSummary = getSummary (resObj); resTable = getResults (resObj);
デモ ファイル single_file_analysis.c
に Polyspace Code Prover™ 解析を実行します。以下のオプションを構成します。
コンパイラとして GCC 4.9 を指定します。
結果を現在の作業フォルダーの
results
サブフォルダーに保存します。ソース コード中に存在しない場合は
main
関数を生成することを指定します。
proj = polyspace.Project % Configure analysis proj.Configuration.Sources = {fullfile(polyspaceroot, 'polyspace', 'examples',... 'cxx', 'Code_Prover_Example', 'sources', 'single_file_analysis.c')}; proj.Configuration.TargetCompiler.Compiler = 'gnu4.9'; proj.Configuration.ResultsDir = fullfile(pwd,'results'); proj.Configuration.CodeProverVerification.MainGenerator = true; % Run analysis cpStatus = proj.run('codeProver'); % Read results resObj = proj.Results; cpSummary = getResults(resObj, 'readable');
入力引数
それぞれ、polyspace.BugFinderResults
オブジェクトまたは polyspace.CodeProverResults
オブジェクトとして指定された Bug Finder または Code Prover の結果セット。
各結果に含める情報の量。''
を指定すると、すべての情報が含まれます。'readable'
を指定すると、次の情報は含まれません。
ID: 現在の解析結果固有の番号。
グループ: 欠陥グループ、チェック グループ、MISRA C:2023 グループなど。
ステータス、重大度、コメント: 結果に関して入力した情報。
この引数を指定しない場合、完全な table が含まれます。
Polyspace 解析結果のエクスポートを参照してください。
出力引数
1 回の Bug Finder 解析または Code Prover 解析のすべての結果を示すテーブル。結果ごとに、ファイル、ファミリなどの情報がテーブルに含まれます。特定の情報が結果に使用できない場合、テーブルのエントリに <undefined>
が示されます。
詳細については、それぞれ以下を参照してください。
テーブルの列については、Polyspace 解析結果のエクスポートを参照してください。
MATLAB table は、tableを参照してください。
バージョン履歴
R2017a で導入
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)