How can I determine if a script is being run by the codegen -test input parameter?
Ältere Kommentare anzeigen
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.
Akzeptierte Antwort
Weitere Antworten (1)
Noam Greenboim
am 7 Mai 2024
you can use the
coder.target
function to determine whether it's a mex or matlab.
Kategorien
Mehr zu Automated Fixed-Point Conversion in MATLAB finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!