IBTestConsole Command Interface (for NUnit, GTest)

The following chapter includes instructions on how to run Incredibuild for Unit Tests when using NUnit or GTest.

Supported Frameworks:

  • NUnit 2

  • NUnit 3

  • Google Test (Gtest)

IBtestConsole will automatically detect the executed framework. However, if you want to force it to run a specific framework, you can use the /test flag described below.

Configuring IBTestConsole

To configure the IBTestConsole, you need to run the IBTestConsole.exe file, located in the Incredibuild installation folder.

Running Unit Tests Using IBTestConsole

The IBTestConsole commands follow the following syntax:

IBTestConsole [Framework Command + Flags] [IBTestConsole Command Line Options]
  • Command- stands for the original command of your Unit tests framework. The command may include specific flags (described below)

  • Options– one of the options described in the section below.

Supported Framework Command Flags

Incredibuild only supports the following framework command flags:

NUnit 2 Supported Flags

Nunit2 CLI reference

  • /run
  • /runlist
  • /include
  • /exclude
  • /result, /xml
  • /noresult, /noxml
  • /framework
  • /timeout

NUnit 3 Command Flags

NUnit3 CLI reference

  • @FILE
  • --testlist=FILE
  • --where=EXPRESSION
  • --config=NAME
  • --framework=FRAMEWORK
  • --timeout=MILLISECONDS
  • --seed=SEED
  • --skipnontestassemblies
  • --result=SPEC
  • --noresult
  • --shadowcopy
  • --noheader, --noh
  • --params | p=PARAMETER
  • --dispose-runners

GTest Command Flags

  • --gtest_output

  • --gtest_output=(json|xml)[:DIRECTORY_PATH|:FILE_PATH]

  • --gtest_filter

  • --gtest_filter=POSTIVE_PATTERNS[-NEGATIVE_PATTERNS]

  • --gtest_also_run_disabled_tests

  • --gtest_repeat=[COUNT]

  • --gtest_shuffle

  • --gtest_random_seed=[NUMBER]

IBTestConsole Command Line Options

The following options can be added at the end of the IBTestConsole command.

Option

Description

Notes

/help

Show this message on the screen

/logfile=<filename>

Specifies the log file name

/loglevel=<level>

Sets logging level. Can be [trace,debug,info,warning,error,fatal]

/openmonitor

Opens the Build Monitor when a test is run

/targetdir=<path>

Specifies the working directory on which the test framework operated.

This command should be used in case the IBTestConsole was not initiated from the same directory as the test assemblies.

/testlevel=<level>

Specifies the test distribution level.

Supported values=[auto, assembly, deep, suite, <number of cores to engage>]. Default value is auto.

  • Assembly – Distribute one assembly per core.

  • Auto - Use the maximum available cores.

  • Deep – Uses all the available cores in the pool, while striving to run each test in a different core.

  • Suite - Distribute based on suites (one suite per core).

  • Number of cores – Limit the number of cores to be used for each assembly. Incredibuild will distribute all the tests evenly between the cores (e.g. if there are 1000 tests and N=200, each of the 200 cores will run 5 tests).

The number of cores to be used may determine the efficiency of the parallelization. In general, you should set the /testlevel=N command option so that N should be around x2.5 of the number of cores that you have on your local machine. To learn more about test level optimization, see Advanced Test Level Optimization.

/test={framework}

Forces IBTestConsole to handle the executed command as a specific framework.

Supported frameworks: 

  • /test=NUnit3

  • /test=NUnit2

  • /test=GTest

/silent

Set silent mode (disable output to console)

 

/MinWinVer=<version>

Minimum required Windows version of helper Agents.

Support values = [XP, 2003, Vista, 2008, 7, 8, 8.1, 10]

 

/MaxWinVer=<version>

Maximum allowed Windows version of helper Agents.

Support values = [XP, 2003, Vista, 2008, 7, 8, 8.1, 10]

 

/out=<filename>

Redirects the entire command line output to a file

 

/title="<text>"

Adds a line of text to build output

 

/inputfile=<filename>

Specify input file name. Only supported for Gtest

 

Return Codes

Code

Description

0

Successfully exited. This means that no internal error occurred during any of the following stages:

  • user command was correct

  • discovery stage finished fine

  • all tests were successfully executed

  • The results were successfully merged (even with test failures)

  • Console output was displayed to the user (if applicable)

1

Internal error during execution for any of stages described above

-1

Unexpected internal error. in real shouldn't ever occur