How can I determine if a script is being run by the codegen -test input parameter?
古いコメントを表示
I would like to avoid running certain lines of code when runing a script that calls a generated mex file (codegen -test or coder.runTest).
I have a script that builds an entry point function "functionA"
codegen -config cfg functionA -args ARGS -test testScript
And I would like to avoid running certain lines of code within testScript only when running the test with codegen (i.e. in the codegen command or with coder.runTest). Is this possible, and if so how.
My first instinct was ~coder.target('MATLAB'), isdeployed, ismcc, however none of these return a true flag when running in test mode.
採用された回答
その他の回答 (1 件)
Noam Greenboim
2024 年 5 月 7 日
you can use the
coder.target
function to determine whether it's a mex or matlab.
カテゴリ
ヘルプ センター および File Exchange で Automated Fixed-Point Conversion in MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!