LinuxCommandLibrary

ctest

Run and test software built with CMake

TLDR

Run all tests defined in the CMake project, executing 4 [j]obs at a time in parallel

$ ctest [[-j|--parallel]] [4] --output-on-failure
copy

List available tests
$ ctest [[-N|--show-only]]
copy

Run a single test based on its name, or filter on a regex
$ ctest --output-on-failure [[-R|--tests-regex]] '^[test_name]$'
copy

SYNOPSIS

ctest [-C configuration] [-V] [-D var[@val]] [-R regex] [options]

PARAMETERS

-A
    Run dashboard script and add tests to current list

-b , --build
    Specify build name for dashboard submission

-C , --build-config
    Choose build configuration (Debug, Release, etc.)

-D [@], --define
    Define dashboard variable or execute script

-E , --exclude-regex
    Exclude tests matching regex

-I [start,end[,stride[,stop]]]
    Run specific range of tests

-j , --parallel
    Run up to jobs tests in parallel

-L
    Run tests with matching label

-M , --test-model
    Set testing model: Experimental, Nightly, Continuous

-O , --output-log
    Write output to log file

-R , --tests-regex
    Run tests matching regex

-S