.. Generated by qibuild/doc/tools/gen_cmake_doc.py .. DO NOT EDIT .. highlight:: cmake Testing ======== This CMake module provides functions to interface gtest with ctest. .. _qi_create_test: qi_create_test -------------- .. cmake:function:: qi_create_test(name [SRC ...] [DEPENDS ...] [TIMEOUT ] [ARGUMENTS ...] [INSTALL] [ ...]) :arg name: the name of the test and the target :arg SRC: sources of the test :arg DEPENDS: the dependencies of the test :arg TIMEOUT: the timeout of the test :arg ARGUMENTS: arguments to be passed to the executable :arg INSTALL: wether the test should be installed (false by default) :arg remaining args: source files (will be merged with the SRC group of 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: qi_create_gtest --------------- .. cmake:function:: qi_create_gtest(name [NO_ADD_TEST] [ ...] [TIMEOUT ] [SRC ...] [DEPENDS ...] [ARGUMENTS ...]) :arg name: name of the test :arg NO_ADD_TEST: Do not call add_test, just create the binary :arg remaining args: source files, like the SRC group, argn and SRC will be merged :arg TIMEOUT: The timeout of the test :arg SRC: Sources :arg DEPENDS: Dependencies to pass to use_lib :arg ARGUMENTS: Arguments to pass to add_test (to your test program) 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: qi_add_test ----------- .. cmake:function:: qi_add_test(test_name target_name [TIMEOUT ] [ARGUMENTS ...]) :arg test_name: The name of the test :arg target_name: The name of the binary to use :arg TIMEOUT: The timeout of the test :arg ARGUMENTS: Arguments to be passed to the executable 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 :ref:`qi_create_test` or :ref:`qi_create_gtest` instead.