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!