Select Git revision
Testing.cmake
Testing.cmake 10.05 KiB
#------------------------------------------------------------------------------
# Project Phoenix
#
# Copyright (c) 2017-2018 RWTH Aachen University, Germany,
# Virtual Reality & Immersive Visualization Group.
#------------------------------------------------------------------------------
# License
#
# Licensed under the 3-Clause BSD License (the "License");
# you may not use this file except in compliance with the License.
# See the file LICENSE for the full text.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#------------------------------------------------------------------------------
include(CTest)
enable_testing()
include(WarningLevels)
conan_or_find_package(catch REQUIRED)
conan_or_find_package(trompeloeil REQUIRED)
define_property(TARGET
PROPERTY testing__removes_libraries
BRIEF_DOCS "Libraries to be removed for mocking"
FULL_DOCS "Libraries to be removed for mocking")
define_property(TARGET
PROPERTY testing__adds_libraries
BRIEF_DOCS "Libraries to be added for mocking"
FULL_DOCS "Libraries to be added for mocking")
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set_property(GLOBAL PROPERTY ADDED_TESTS "")
set(IS_BUILD_SERVER
FALSE CACHE BOOL
"Is this the build server? So we, e.g., simulate user input for tests requiring it."
)
function(CREATE_TEST_MAIN)
set(options)
set(oneValueArgs )
set(multiValueArgs SOURCES HEADERS INCLUDE_DIRECTORIES LIBRARIES )
cmake_parse_arguments(CREATE_TEST_MAIN_
"${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
testing__add_library_(
NAME test_main
SOURCES ${CREATE_TEST_MAIN__SOURCES} ${CREATE_TEST_MAIN__HEADERS}
INCLUDE_DIRECTORIES ${CREATE_TEST_MAIN__INCLUDE_DIRECTORIES}
LIBRARIES ${CREATE_TEST_MAIN__LIBRARIES}
)
endfunction()
function(CREATE_MOCK_MAIN)
set(options)
set(oneValueArgs )
set(multiValueArgs SOURCES HEADERS INCLUDE_DIRECTORIES LIBRARIES )
cmake_parse_arguments(CREATE_MOCK_MAIN_
"${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})