mardi 26 mars 2019

How to compile a Matlab code with Testing classes?

I'm trying to compile a Matlab code with mcc, including some tests classes that I wrote with Matlab's unittest module. But I don't know how to process...

I have a main.m with many dependencies to others functions. My tests classes are in an other folder. In my tests classes, I need a call to main.m to make my assertions.

My idea was to modify my main.m to add a boolean argument like launchTests. If it's true, I only call runtests() and it will make a recursive call to main.m. Else, I execute the code.

I'm not fan of this idea, is there something more elegant for my problem ? Is it possible to make options with mcc (like calling main() --launchTests) ?

Aucun commentaire:

Enregistrer un commentaire