Qbs Manual | AutotestRunner Item

Qbs 1.7.2

ApplicationExtension Item ◦ CppApplication Item

# AutotestRunner Item

An `AutotestRunner` has a dependency to all products with the type "autotest". "Building" the `AutotestRunner` product will then run the respective executables. The `builtByDefault` property of an `AutotestRunner` is set to `false` by default, so running the autotests has to be explicitly requested. The default name of the product is "autotest-runner". To use this feature, do the following:

1. Attach the "autotest" type to your autotests:

         CppApplication {
             name: "tst_mytest"
             type: ["application", "autotest"]
             // ...
         }

2. Instantiate exactly one `AutotestRunner` in your project, typically at the top level:

         Project {
             // ...
             AutotestRunner { }
             // ...
         }

3. Trigger the autotest execution by "building" the product:

         qbs build -p autotest-runner

## AutotestRunner Properties

Property | Type | Default | Description
--- | --- | --- | ---
arguments | stringList | empty | The list of arguments to invoke the autotest with.
environment | stringList | set internally | A list of environment variables that are added to the run environment. They are provided as a list of strings in the form "varName=value". By default, DYLD_LIBRARY_PATH, DYLD_FRAMEWORK_PATH, and DYLD_ROOT_PATH are set on macOS, or an empty list for other platforms.
limitToSubProject | bool | `true` | By default, only those autotests are considered that are in the same sub-project that the `AutotestRunner` was instantiated in. If you want to run all autotests regardless of their location in the project hierarchy, set this property to `false`.
wrapper | stringList | empty | Wrapper binary and its arguments for wrapping autotest calls. This is useful for tools like Valgrind and alike.

ApplicationExtension Item ◦ CppApplication Item