mirror of
https://github.com/Icinga/icinga2.git
synced 2025-09-22 01:08:04 +02:00
This adds a global fixture that can parse an additional argument to the test executables (`--generate_ctest_config`). When run by CMake during build, this generates a CTest script containing all the tests and their properties. An additional decorator, that defines CTest properties for a test case or suite that will be added to the tests during config generation. This version needs no hacks, no huge CMake scripts, just a bit of additional C++ code that iterates over all test-cases and collects the information CTest needs. One caveat is still that this does not work with cross-compilation, which probably isn't an issue to begin with, but there are also ways to fix that if necessary.
18 lines
546 B
C
18 lines
546 B
C
/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
|
|
|
|
#pragma once
|
|
|
|
// This will only be defined if cmake couldn't find a static or dynamic library to link against.
|
|
#cmakedefine BOOST_TEST_USE_INCLUDED
|
|
|
|
// Only one file needs to include the implementation files
|
|
#if defined(BOOST_TEST_USE_INCLUDED) && defined(TEST_INCLUDE_IMPLEMENTATION)
|
|
#include <boost/test/included/unit_test.hpp>
|
|
|
|
#else
|
|
|
|
//If a dynamic library was found, this will be defined before including the header.
|
|
#cmakedefine BOOST_TEST_DYN_LINK
|
|
#include <boost/test/unit_test.hpp>
|
|
#endif
|