This CMake module provides functions to interface gtest with ctest.
qi_create_test(name [SRC <src> ...]
[DEPENDS <depends> ...]
[TIMEOUT <timeout>]
[ARGUMENTS <arguments> ...]
[INSTALL]
[<remaining args> ...]
)
Arguments: |
|
---|
Create a new test. Note that the resulting executable will NOT be installed by default. The name of the test will match the target name
qi_create_gtest(name [NO_ADD_TEST]
[<remaining args> ...]
[TIMEOUT <timeout>]
[SRC <src> ...]
[DEPENDS <depends> ...]
[ARGUMENTS <arguments> ...]
)
Arguments: |
|
---|
This compiles and add_test’s a CTest test that uses gtest. (so that the test can be run by CTest)
When running ctest, an XML xUnit xml file wiil be created to ${CMAKE_SOURCE_DIR}/test-results/${test_name}.xml
The name of the test will always be the name of the target.
qi_add_test(test_name target_name [TIMEOUT <timeout>]
[ARGUMENTS <arguments> ...]
)
Arguments: |
|
---|
Add a test using a binary that was created by qi_create_bin This calls add_test() with the same arguements but:
- We look for the binary in sdk/bin, and we know there is a _d when using Visual Studio
- We set a ‘tests’ folder property
- We make sure necessary environment variables are set on mac
This is a low-level function, you should rather use qi_create_test or qi_create_gtest instead.