主要内容

在 Polyspace 平台用户界面中执行代码探查

R2026b
计算与现有测试相关的 C/C++ 源代码覆盖率、计算执行时间

您可以在 Polyspace 平台用户界面中计算 C/C++ 代码覆盖率、执行时间或内存使用。在启用了覆盖率、执行探查或内存探查的情况下执行测试后,您可以结合测试结果来查看测试覆盖了多少代码,或查找执行时间或栈使用量方面的瓶颈。

Polyspace 选项

全部展开

要探查的文件夹 (-limit-instrumentation-to)Specify folders containing sources to be instrumented for code profiling (自 R2023b 起)
要忽略的文件夹 (-ignore-dir)Specify folders to ignore during instrumentation (自 R2023b 起)
要忽略的文件 (-ignore-file)Specify files to exclude from source code instrumentation (自 R2023b 起)
附加选项Specify additional instrumentation options (自 R2023b 起)
探查的类型Profile one of code coverage, execution time, or memory use (自 R2023b 起)
覆盖率等级 (-cov-metric-level)Specify level of code coverage metric calculation (自 R2023b 起)
为覆盖率计算启用精简模式 (-compact)Reduce the amount of memory required to run test executable (自 R2023b 起)
启用关系边界覆盖率 (-cov-relbound)Specify whether to calculate relational boundary coverage (自 R2023b 起)
绝对容差 (-cov-relbound-abs-tol)Specify absolute tolerance for relational boundary coverage (自 R2023b 起)
相对容差 (-cov-relbound-rel-tol)Specify relative tolerance for relational boundary coverage (自 R2023b 起)
要忽略的函数 (-ignore-fcn)Specify functions to exclude from source code instrumentation (自 R2023b 起)
要忽略的函数调用 (-ignore-fcn-call)Specify function calls to exclude from source code instrumentation (自 R2023b 起)
按类别选择 (-sanitizer-selection errorType)Select sanitizer checks by error category (自 R2026b 起)
数值错误 (-sanitizer-selection numeric)Enable detection of numeric errors at runtime (自 R2026b 起)
内存错误 (-sanitizer-selection memory)Enable detection of memory errors at runtime (自 R2026b 起)
内存泄漏 (-sanitizer-selection memleak)Enable detection of memory leaks at runtime (自 R2026b 起)
从结果文件中选择 (-sanitizer-selection filePath)Select sanitizer checks guided by a Code Prover results file (自 R2026b 起)
Code Prover 结果文件 (-sanitizer-selection filePath)Specify path to a Code Prover results file for guided sanitization (自 R2026b 起)
最大错误出现次数 (-sanitizer-max-error-occurrences)Specify the maximum number of sanitizer error occurrences to report (自 R2026b 起)

MATLAB 函数

pstest.exportToPolyspaceProfilingResults(MATLAB Function) Export coverage results from Simulink Coverage, Simulink Test, or MATLAB Test to Polyspace Test

主题

所有探查

代码覆盖率

执行时间和内存使用

代码清理