How do you write and run C++ tests?
...and I've found a few things in the forums about it, like https://forums.unrealengine.com/showthread.php?56106-Need-Help-with-Automation-Testing-in-4-6&s=99364033047c10ddb8f3781b137cb2a6
However, I still fail to understand a few basic things about tests for the engine.
1) There are lots of flags for tests in Engine/Source/Runtime/Core/Public/Misc/AutomationTest.h. Which ones are for what?
Specifically, for example, say I have:
At a technical level, what do these flags actually do?
2) Why does the hot reload not reload tests?
I literally have to restart the editor to get the automation tool to load the new versions of the tests.
I've tried disconnecting from the session, reconnecting, etc. and no luck.
3) Given that you have to restart the editor to rerun tests, how do you invoke them from the command line?
There's some suggestion you can use the RunUAT tool for this, but I can't find what combination of flags to pass it.
I do not want to generate a build of the whole project, and assume that I have already used Build.sh to confirm that the tests compile; I literally just want to run the automation tool and get the results (ideally in a text format that can easily be parsed).
asked Mar 17 '15 at 03:29 AM in C++ Programming
fwiw if anyone else finds this question, the closest I ever got to an answer was: http://stackoverflow.com/questions/29135227/how-do-you-run-tests-from-the-command-line
Didn't work for me.
Just write your own tests in your own C++ test framework and trigger them yourself manually.
answered Mar 27 '15 at 08:06 AM
This is a super fast test, so you can add
Your final flags parameter would therefore look like this:
The in-code documentation in AutomationTest.h of the flags is actually pretty good for these enum values.
There is a bug open for this: https://issues.unrealengine.com/issue/UE-25350 and marked as "backlogged", so fingers crossed that this will work some day.
Find the answer to that here: https://answers.unrealengine.com/questions/354798/running-command-line-automation-tests-410.html
answered Dec 14 '17 at 02:07 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here