Explore Tipi

Running tests cases

Running tests cases

The convention build will categorize applications (i.e. .cpp files with entry points) found in the test[s] or example[s] folders as tests and supports automatically executing them post-build.

The return code of the application is interpreted as pass/fail result.

Run all tests

$> tipi . -t linux-cxx17 --test all

Run specific tests

Run only tests defined in test/mytest.cpp

$> tipi . -t linux-cxx17 --test test/mytest

The value of the parameter can be a regex used to match the name of one or multiple test executables

If you need to exclude a number of tests from the suite you can supply a filter regex to match the tests to ignore:

$> tipi . -t linux-cxx17 --test all --exclude-test mytest1|mytest2 # run all tests except 'mytest1' and 'mytest2'

Additionally you may use the <project-root>/.tipi.force-tests file to override or specify the the value of the --test parameter in a persistent way. This enables you to change the value during monitor mode builds (even enabling them if you started the live build without specifying --test at all) or for use in CI.

Passing parameters to the test executable

In some cases you will find the need to pass parameters to the test executable (for example for test case filtering). Tipi provides two mechanism to do so:

On the command line, use --test-args to specify the command line arguments passed to every selected test executable

Example: disable the test "intro" output and use minimal logging in a doctest based test:

$> tipi . -t linux-cxx17 --test test/mytest --test-args "--no-intro=true --minimal" 

Alternatively the value of --test-args can be specified in the <project-root>/.tipi.test-args file. This overrides the value set on the command line to enable changing the settings during a live build.

Example: Set the parameters from the first example using the <project-root>/.tipi.test-args file:

--no-intro=true
--minimal

Run the test:

$> tipi . -t linux-cxx17 --test test/mytest

Note: any newline or CR+LF character in the file content will be replaced by a single white space from the file content, so you may specify the passed parameters on distinct lines

Running tests on each keystroke

Read more about the combining tests executions on tipi.build cloud and the Live build / monitor mode