Skip to content

Add testbuild target which builds tests without running them #2083

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,8 @@ endif()
gnc_gtest_configure()

# There are targets that need to build before tests will run
add_custom_target(check
add_custom_target(testbuild)
add_custom_target(check DEPENDS testbuild
COMMAND ${CMAKE_CTEST_COMMAND}
)

Expand Down
2 changes: 1 addition & 1 deletion common/cmake_modules/GncAddTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function(gnc_add_test _TARGET _SOURCE_FILES TEST_INCLUDE_VAR_NAME TEST_LIBS_VAR_
target_link_libraries(${_TARGET} PRIVATE ${TEST_LIBS})
target_include_directories(${_TARGET} PRIVATE ${TEST_INCLUDE_DIRS})
set_tests_properties(${_TARGET} PROPERTIES ENVIRONMENT "${ENVVARS}$<$<CONFIG:Asan>:;ASAN_OPTIONS=${ASAN_TEST_OPTIONS}>")
add_dependencies(check ${_TARGET})
add_dependencies(testbuild ${_TARGET})
endfunction()

function(gnc_add_test_with_guile _TARGET _SOURCE_FILES TEST_INCLUDE_VAR_NAME TEST_LIBS_VAR_NAME)
Expand Down
Loading