Conditional code for quicktest

My game has some code that I’d like to skip in tests (e.g slow recursive algorithms). For random tests, I can easily do

*if not(choice_randomtest)

While there is a similar variable called choice_quicktest, my code seems to be executed during quicktest even if I guard with a check

*if not(choice_quicktest)

Does anybody have any suggestions? Thanks!

QuickTest “cheats” and checks every outcome of a conditional, even if it’s impossible to reach it, so no, I don’t think so.

You might be able to work around it by saying *if choice_quicktest, *goto somewhereelsethatavoidsrunningmycode… But I wouldn’t be surprised if it still tried to execute the rest.

1 Like

Thanks @CJW. Something that works is that, if you do *if choice_quicktest, the code will be taken by quicktest, and not by the actual game. Still, there is apparently no way to exclude code in quicktest.

BTW, I fail to understand how that happens, as I don’t see an override to Scene.prototype[“if”] or Scene.prototype[“else”] in autotest.js. Do you know how quicktest follows both branches?

AFAIK (not spent a great deal of time analyzing it), QuickTest doesn’t actually “execute” your code, it just scans it.

1 Like