# Run automated testing from command line

**URL:** <https://forums.unrealengine.com/t/run-automated-testing-from-command-line/294995>\
**Category:** Platform & Builds\
**Tags:** automated-testing, command-line, unreal-engine, test, question\
**Created:** [October 1, 2014, 12:38pm UTC](https://forums.unrealengine.com/t/run-automated-testing-from-command-line/294995 "2014-10-01T12:38:14Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_69853c21](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_69853c21](https://forums.unrealengine.com/u/anonymous_user_69853c21)\
**Post date:** [October 1, 2014, 12:38pm UTC](https://forums.unrealengine.com/t/run-automated-testing-from-command-line/294995/1 "2014-10-01T12:38:14Z")

</div>

Greetings,  
In BuildTools presentation ([link](https://www.unrealengine.com/resources)) I found that I can run tests with command line. Can someone provide an example please?

---

<div class="post-metadata">

**Author:** ![HairJustin\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@HairJustin\_1](https://forums.unrealengine.com/u/HairJustin_1)\
**Post date:** [October 6, 2014, 3:40pm UTC](https://forums.unrealengine.com/t/run-automated-testing-from-command-line/294995/2 "2014-10-06T15:40:32Z")

</div>

Hello,

To run all of the automation tests in a project:  
UE4Editor.exe GAMENAME -Game -ExecCmds=“Automation RunAll”

or

To run a single test:  
UE4Editor.exe GameName -game -execcmds=“Automation Run FSetRestTest”

You can find the list of tests by running -execcmds=“Automation List”. In the output log you’ll see a long list of tests. Each test name has the letter “F” in front of it.

Here’s some more info on the automation system:

Creating a test:

> **[Automation Technical Guide](https://docs.unrealengine.com/5.1/en-US/automation-technical-guide/)**
>
> Programmer's guide to creating engine-level Automation Tests.

Overview:

> **[Automation System Overview](https://docs.unrealengine.com/5.1/en-US/automation-system-in-unreal-engine/)**
>
> Overview of the automation system used for unit testing, feature testing, and content stress testing.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2db7ca80](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2db7ca80](https://forums.unrealengine.com/u/anonymous_user_2db7ca80)\
**Post date:** [November 12, 2014, 3:37pm UTC](https://forums.unrealengine.com/t/run-automated-testing-from-command-line/294995/3 "2014-11-12T15:37:07Z")

</div>

How would you execute a group of tests (or indeed even a complex test like FCompileBlueprintsTest) Obviously don’t want to have to list in the command line all the Blueprints… Alternatively would be a way to trigger a preset collection of auto tests?

---

<div class="post-metadata">

**Author:** ![HairJustin\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@HairJustin\_1](https://forums.unrealengine.com/u/HairJustin_1)\
**Post date:** [November 12, 2014, 6:15pm UTC](https://forums.unrealengine.com/t/run-automated-testing-from-command-line/294995/4 "2014-11-12T18:15:48Z")

</div>

To run a preset collection through command line is not currently possible but it is on our list of things to do.

You can run the individual tests from a complex test or you can run 'em all.

To run an individual test use this command argument:

_-AutomationTests=“Pretty.TestName”_

Example:

_-AutomationTests="Blueprints.Compile Blueprints.My Awesome Blueprint, “Blueprints.Compile Blueprints.MyOKBlueprint”_

To run all of a complex test then use:

_-Execcmds=“Automation Run FCompileBlueprintsTest”_

Does this answer your question?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2db7ca80](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2db7ca80](https://forums.unrealengine.com/u/anonymous_user_2db7ca80)\
**Post date:** [November 13, 2014, 10:36am UTC](https://forums.unrealengine.com/t/run-automated-testing-from-command-line/294995/5 "2014-11-13T10:36:22Z")

</div>

When I run with `-Execcmds="Automation Run FCompileBlueprintsTest"` I get

`ERROR: Failed to find test FCompileBlueprintsTest`

I have double checked the name of the test (copied and pasted from a list command). The only way I can get it to work is by specifying a specific BP. We are using UE4.4.

---

<div class="post-metadata">

**Author:** ![HairJustin\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@HairJustin\_1](https://forums.unrealengine.com/u/HairJustin_1)\
**Post date:** [November 13, 2014, 1:58pm UTC](https://forums.unrealengine.com/t/run-automated-testing-from-command-line/294995/6 "2014-11-13T13:58:11Z")

</div>

By chance, are you attempting to run the blueprint test in the game? That test is flagged as Editor only so it won’t work if you run it in game.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2db7ca80](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2db7ca80](https://forums.unrealengine.com/u/anonymous_user_2db7ca80)\
**Post date:** [November 14, 2014, 6:07pm UTC](https://forums.unrealengine.com/t/run-automated-testing-from-command-line/294995/7 "2014-11-14T18:07:14Z")

</div>

I am not running with the -game tag and it correctly launches the editor.

I’m not sure how I ever got `-Execcmds="Automation Run FCompileBlueprintsTest /some/path/to/blueprint`" from the command line to work as even that doesn’t work (even that says can’t find test when the editor launches).

However, if I run `Automation Run FCompileBlueprintsTest /some/path/to/blueprint` in the command line from the Session Frontend, that works. But even then, running `Automation Run FCompileBlueprintsTest` says it can’t find that test.

---

<div class="post-metadata">

**Author:** ![HairJustin\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@HairJustin\_1](https://forums.unrealengine.com/u/HairJustin_1)\
**Post date:** [November 14, 2014, 9:15pm UTC](https://forums.unrealengine.com/t/run-automated-testing-from-command-line/294995/8 "2014-11-14T21:15:20Z")

</div>

My apologies I was wrong about the -execcmd being able to easily run all of the complex tests for an automation test. ☹

You’ll wan to run with: _-automationtests=“Blueprints.Compile-On-Load”_

The couple of issue with that is the editor/game will exit once the automation test que is empty which is fine if that is what you want it to do. This also may or may not run all of the available complex tests.

I’ve logged these issues into our database to hopefully make this easier to use.

To get a full name of a complex test you can run the editor or game with _-Execcmds=“Automation List”_ or in the editors console window entering _Automation List_. That will give you the full list.

---

<div class="post-metadata">

**Author:** ![Mike\_Kelly](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mike\_Kelly](https://forums.unrealengine.com/u/Mike_Kelly)\
**Post date:** [June 20, 2015, 3:52am UTC](https://forums.unrealengine.com/t/run-automated-testing-from-command-line/294995/9 "2015-06-20T03:52:39Z")

</div>

`-ExecCmds="Automation Run FCompileBlueprintsTest"` does not work. `-AutomationTests="Blueprints.Compile Blueprints"` does not work. But `-AutomationTests="Project.Blueprints.Compile Blueprints"` does work. That’s the PrettyName for FCompileBlueprintsTest, as defined in BlueprintAutomationTests.cpp.

---

<div class="post-metadata">

**Author:** ![HairJustin\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@HairJustin\_1](https://forums.unrealengine.com/u/HairJustin_1)\
**Post date:** [June 22, 2015, 6:10pm UTC](https://forums.unrealengine.com/t/run-automated-testing-from-command-line/294995/10 "2015-06-22T18:10:50Z")

</div>

You are correct Mike. Recently there have been some minor changes to how automation is run through the command line.

“-ExecCmds=“Automation Run FCompileBlueprintsTest””

In this example you’ll need to also specify the asset that is being tested. You can easily find the whole path for that file by running Automation List either as an execcmd or in the console window. The print out will be in your output log.

“-AutomationTests=“Blueprints.Compile Blueprints””

Even though the automationtests= command line can use partial arguments you’ll need to include everything before the test name itself. For example if I just wanted to run all of the blueprints it would look like this: "-automationtests=“Project.Blueprints” or if I wanted to run compile all blueprints that start with the letter A I would use this: -automationtests=“Project.Blueprints.Compile Blueprints.A”.

Heads up though, this will be changing in the next release. For the better. 🙂

---

<div class="post-metadata">

**Author:** ![Samlsewall](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Samlsewall](https://forums.unrealengine.com/u/Samlsewall)\
**Post date:** [January 11, 2016, 5:02pm UTC](https://forums.unrealengine.com/t/run-automated-testing-from-command-line/294995/11 "2016-01-11T17:02:12Z")

</div>

Hey just a heads up, I do not believe that your answer works with the current version of Unreal.

I believe it was updated, but this is what I’ve found to work.

What you want to do is to call the following for specific tests from your Engine/Binaries/Win64 directory (or whatever directory your UE4Editor.app… etc is in):

```
UE4Editor.exe "[PathFromUnrealEditorBinaryToYourProjectDirectory]/[ProjectName].uproject" -Game -ExecCmds="Automation RunTests [TestPrettyName]" -log

```

In order to get all of the Pretty names for the tests run the following command:

```
UE4Editor.exe "[PathFromUnrealEditorBinaryToYourProjectDirectory]/[ProjectName].uproject" -Game -ExecCmds="Automation List" -log

```

You can call multiple tests using this method if you have a Pretty name that encapsulates multiple tests. for Example:

I have the following tests under my AI code: “TytoDome.AI.2Animals1Plant”,  
“TytoDome.AI.Save The Animals”, “TytoDome.AI.Animal Hunting”, “TytoDome.AI.Fish Eating”. As well as the following tests in my Data Tool: “TytoDome.Data Tool.Unique EcoRole Collection”, “TytoDome.Data Tool.Zone Birth and Death and Unlocking”, “TytoDome.Data Tool.Animal Collection General”.

If I wanted to call EVERY test I have, I would use the following command:

```
UE4Editor.exe "[PathFromUnrealEditorBinaryToYourProjectDirectory]/[ProjectName].uproject" -Game -ExecCmds="Automation RunTests TytoDome" -log

```

If I wanted to call ONLY my AI Tests I’d run the following:

```
UE4Editor.exe "[PathFromUnrealEditorBinaryToYourProjectDirectory]/[ProjectName].uproject" -Game -ExecCmds="Automation RunTests TytoDome.AI" -log

```

If I wanted to call ONLY my Animal hunting Test I’d run the following:

```
UE4Editor.exe "[PathFromUnrealEditorBinaryToYourProjectDirectory]/[ProjectName].uproject" -Game -ExecCmds="Automation RunTests TytoDome.AI.Animal Hunting" -log

```

From here anyone should be able to figure out how to get this to work with their project!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_dc459d0d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_dc459d0d](https://forums.unrealengine.com/u/anonymous_user_dc459d0d)\
**Post date:** [August 11, 2016, 1:12am UTC](https://forums.unrealengine.com/t/run-automated-testing-from-command-line/294995/12 "2016-08-11T01:12:01Z")

</div>

Any chance there is some documentation on -AutomationTests? I was hoping to find some details on it here ([Command-Line Arguments in Unreal Engine | Unreal Engine 5.1 Documentation](https://docs.unrealengine.com/latest/INT/Programming/Basics/CommandLineArguments/index.html)).

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b8fb83bb](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b8fb83bb](https://forums.unrealengine.com/u/anonymous_user_b8fb83bb)\
**Post date:** [July 10, 2017, 5:46am UTC](https://forums.unrealengine.com/t/run-automated-testing-from-command-line/294995/13 "2017-07-10T05:46:19Z")

</div>

I’ve tested, command line  
“Automation RunTests Project.Blueprints.CompileBlueprints”  
does work, there’s no space between Compile and Blueprints, hope this can help you

---

<div class="post-metadata">

**Author:** ![SRombauts](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SRombauts](https://forums.unrealengine.com/u/SRombauts)\
**Post date:** [October 24, 2018, 6:11pm UTC](https://forums.unrealengine.com/t/run-automated-testing-from-command-line/294995/14 "2018-10-24T18:11:42Z")

</div>

To run unit tests from the command line, log to a file (and have a log popup), and exit after the tests, here is what I use:

```
UE4Editor.exe Path/To/MyProject.uproject -ExecCmds="Automation RunTests MyProject" -unattended -nopause -testexit="Automation Test Queue Empty" -log -log=RunTests.log

```

I wanted to also use -NullRHI to avoid seeing the Editor (and the associated Slate load) but this presently crashs UE4.20 at exit

Edit: also, I’ve updated the command line to get a Tests Report using the option -ReportOutputPath.  
Here is our current complete commande line:

```
UnrealEngine\Engine\Binaries\Win64\UE4Editor.exe "C:\workspace\MyProject\MyProject.uproject" -ExecCmds="Automation RunTests MyProject" -Unattended -NullRHI -TestExit="Automation Test Queue Empty" -ReportOutputPath="C:\workspace\MyProject\Saved\TestReport" -Log -Log=RunTests.log
```

---

<div class="post-metadata">

**Author:** ![Emidee](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Emidee](https://forums.unrealengine.com/u/Emidee)\
**Post date:** [November 5, 2018, 10:25am UTC](https://forums.unrealengine.com/t/run-automated-testing-from-command-line/294995/15 "2018-11-05T10:25:03Z")

</div>

Do you manage to see which tests fail?

I purposely made one test fail. When I run the tests in the editor, the logs state the failure.  
When I run the tests from the command line, there is no mention of it 😕

---

<div class="post-metadata">

**Author:** ![SRombauts](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SRombauts](https://forums.unrealengine.com/u/SRombauts)\
**Post date:** [November 6, 2018, 12:50pm UTC](https://forums.unrealengine.com/t/run-automated-testing-from-command-line/294995/16 "2018-11-06T12:50:12Z")

</div>

Yes, in case of failure I do get a error log.  
I will also make a script to parse the index.json report

---

<div class="post-metadata">

**Author:** ![Emidee](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Emidee](https://forums.unrealengine.com/u/Emidee)\
**Post date:** [November 6, 2018, 2:27pm UTC](https://forums.unrealengine.com/t/run-automated-testing-from-command-line/294995/17 "2018-11-06T14:27:59Z")

</div>

Thanks. I found out the issue I had, which is a bug (now fixed in 4.21): when you run the tests and the session frontend is opened, no test is run. Now that it works in the command line, I need to find out why in my Jenkins, the editor tries to compile all the shaders when it did not have to when I cooked the game data…

---

<div class="post-metadata">

**Author:** ![SRombauts](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SRombauts](https://forums.unrealengine.com/u/SRombauts)\
**Post date:** [November 6, 2018, 2:42pm UTC](https://forums.unrealengine.com/t/run-automated-testing-from-command-line/294995/18 "2018-11-06T14:42:55Z")

</div>

Ok, good to know!  
Also, I would like to know how you parse the results. I am currently using the Warnings Plugin but it does not fail the build as it should using thresholds.  
At the end of the day, the real proper method IMO is to convert the json into JUnit test result so that the proper Jenkins plugin can display all appropriate info

---

<div class="post-metadata">

**Author:** ![Emidee](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Emidee](https://forums.unrealengine.com/u/Emidee)\
**Post date:** [November 6, 2018, 2:52pm UTC](https://forums.unrealengine.com/t/run-automated-testing-from-command-line/294995/19 "2018-11-06T14:52:00Z")

</div>

Right now I did not have a chance to go that far since I do not have (yet!) the unit tests results in the log but my plan was to use the warnings plugin, with a custom regexp, and to fail the build if any test fails

---

<div class="post-metadata">

**Author:** ![SRombauts](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SRombauts](https://forums.unrealengine.com/u/SRombauts)\
**Post date:** [November 6, 2018, 3:25pm UTC](https://forums.unrealengine.com/t/run-automated-testing-from-command-line/294995/20 "2018-11-06T15:25:16Z")

</div>

I am doing that using Jenkins Pipeline with the following config:

```
warnings failedTotalAll: '0', parserConfigurations: [[parserName: 'UnrealTestReports', pattern: 'Saved\\TestReport\\index.json']]

```

With a very basic regular expression to catch the global status (so does not count how many failures):

```
Regular Expression: ^\s*"state": "Fail",$
```

[Next page](https://forums.unrealengine.com/t/run-automated-testing-from-command-line/294995.md?page=2)
