# # This file is a part of the CaosDB Project. # # Copyright (C) 2021 Timm Fitschen <t.fitschen@indiscale.com> # Copyright (C) 2021 IndiScale GmbH <info@indiscale.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. # # append all the test cases here (file name without the ".cpp" suffix) set(test_cases test_connection ) find_package(caosdb REQUIRED) include(FetchGTest) # add special cmake functions for gtest include(GoogleTest REQUIRED) # loop over all test cases and add them to the test runner list(LENGTH test_cases len_test_cases) math(EXPR len_test_cases "${len_test_cases} - 1") foreach (i RANGE "${len_test_cases}") list(GET test_cases ${i} test_case_name) add_executable(${test_case_name} ${test_case_name}.cpp) target_link_libraries(${test_case_name} PRIVATE gtest_main caosdb::caosdb) set_target_properties(${test_case_name} PROPERTIES CXX_CLANG_TIDY "") gtest_discover_tests(${test_case_name} PROPERTIES LABELS "caosdb-cpplib-int-tests") endforeach ()