主要内容

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

计算与现有测试相关的 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 起)

MATLAB 函数

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

主题

代码覆盖率

执行时间和内存使用

代码清理