We will now describe how to configure, build, test, and finally, submit the test results for our example project to the dashboard:
- The source targets are defined in src/CMakeLists.txt, as follows:
# example libraryadd_library(sum_integers "")target_sources(sum_integers PRIVATE sum_integers.cpp PUBLIC ${CMAKE_CURRENT_LIST_DIR}/sum_integers.hpp )target_include_directories(sum_integers PUBLIC ${CMAKE_CURRENT_LIST_DIR} )# main codeadd_executable(sum_up main.cpp)target_link_libraries(sum_up sum_integers)
- The tests are defined in tests/CMakeLists.txt:
add_executable(test_short test_short.cpp)target_link_libraries(test_short sum_integers)add_executable(test_long test_long.cpp)target_link_libraries(test_long sum_integers)add_test( ...