X-Git-Url: https://git.siccegge.de//index.cgi?p=software%2FDIPE.git;a=blobdiff_plain;f=tests%2FCMakeLists.txt;fp=tests%2FCMakeLists.txt;h=288ed8c947c0178b29d6c6ae271e51908dfd4026;hp=0000000000000000000000000000000000000000;hb=006e87bc592a4e6eabea4f7f9caab8e218ebfd85;hpb=5cb1a82c4ddb3fd578e6b99cce46406e1a6b357f diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 0000000..288ed8c --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,20 @@ +macro(package_add_test TESTNAME) + # create an exectuable in which the tests will be stored + add_executable(${TESTNAME} ${ARGN}) + # link the Google test infrastructure, mocking library, and a default main fuction to + # the test executable. Remove g_test_main if writing your own main function. + target_link_libraries(${TESTNAME} gtest gtest_main DIPE) + # gtest_discover_tests replaces gtest_add_tests, + # see https://cmake.org/cmake/help/v3.10/module/GoogleTest.html for more options to pass to it + gtest_discover_tests(${TESTNAME} + # set a working directory so your project root so that you can find test data via paths relative to the project root + WORKING_DIRECTORY ${PROJECT_DIR} + PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${PROJECT_DIR}" + ) + set_target_properties(${TESTNAME} PROPERTIES FOLDER tests) +endmacro() + +add_subdirectory(/usr/src/gtest gtest) + +package_add_test(testDIPE testDIPE.cpp) +package_add_test(testPBC testPBC.cpp)