Test
Defines the execution of an executable as a test.
The Test function is used to create a target that is used to execute tests. It may depend on other FASTBuild targets via the .TestExecutable option.
When a test is run, its output (standard output and error channel) is captured and will be written to the file specified in .TestOutput. The captured output will not be shown directly (printed to FASTBuild's output) unless the test process has a non-zero return value. This is done in order to keep FASTBuild's output clean and reduce noise.
.TestExecutable - String - (Required)
The executable file to run that will execute the tests.
Can either be a file path or the name of a target specified with the Executable function.
.TestOutput - String - (Required)
Output file for captured test output.
When executing tests, FASTBuild will capture standard output channels of the executable and write them to this file when done.
.TestArguments - String - (Optional)
Arguments to pass to test executable.
.TestWorkingDir - String - (Optional)
Working dir for test execution.
.TestTimeOut - Integer - (Optional)
The amount of time (in seconds) to wait for a test to finish execution.
The default is 0, which means there is no timeout and FASTBuild will wait until the executable terminates on its own.
.TestAlwaysShowOutput - Boolean - (Optional)
The output of a test is normally shown only when the test fails. This option specifies that the output should always be shown.
.PreBuildDependencies - String/ArrayOfStrings - (Optional)
One or more nodes which must be built before this test is executed.
The .PreBuildDependencies option ensures the specified targets are up-to-date before the Test() is executed.
.ConcurrencyGroupName - String - (Optional)
A Concurrency Group can optionally be specified to constrain concurrent task execution.
.Environment - String or ArrayOfStrings - (Optional)
When set, overrides the environment for running a Test.
This allows you to have a different environment per Test if needed.