Skip to content

Commit

Permalink
[cmake] Add optional variable to boost_geometry_add_unit_test
Browse files Browse the repository at this point in the history
  • Loading branch information
vissarion committed Sep 5, 2024
1 parent e45fa58 commit c50159e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
10 changes: 5 additions & 5 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ function(boost_geometry_add_unit_test prefix item)
target_compile_features(${unit_test_name} PRIVATE cxx_std_14)

# To be able to run ctest
if (NOT ("boost_geometry_${prefix}_${item}" STREQUAL "boost_geometry_cs_undefined_setops1") AND
NOT ("boost_geometry_${prefix}_${item}" STREQUAL "boost_geometry_cs_undefined_setops2"))
add_test(NAME ${unit_test_name} COMMAND ${unit_test_name})
endif()
add_test(NAME ${unit_test_name} COMMAND ${unit_test_name})

# Add a dependency to the global tests target
add_dependencies(tests ${unit_test_name})
set(extra_macro_args ${ARGN})
if (NOT extra_macro_args STREQUAL "not_run")
add_dependencies(tests ${unit_test_name})
endif()

# Inform the caller about the test name. It can then set defines, if necessary.
set(BOOST_GEOMETRY_UNIT_TEST_NAME ${unit_test_name} PARENT_SCOPE)
Expand Down
5 changes: 3 additions & 2 deletions test/cs_undefined/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ foreach(item IN ITEMS
other
relops1
relops2
setops1
setops2
)
boost_geometry_add_unit_test("cs_undefined" ${item})
endforeach()

#boost_geometry_add_unit_test("cs_undefined" setops1 "not_run")
#boost_geometry_add_unit_test("cs_undefined" setops2 "not_run")

0 comments on commit c50159e

Please sign in to comment.