From 7fa4bf7b4d9e8fcf63218994f40a83234a97a26a Mon Sep 17 00:00:00 2001 From: Vissarion Fisikopoulos Date: Sat, 10 Aug 2024 14:29:00 +0300 Subject: [PATCH 1/9] Declared tests as EXCLUDE_FROM_ALL for build with cmake --- CMakeLists.txt | 2 +- test/policies/CMakeLists.txt | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b859fe83..5da9cc9cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -123,7 +123,7 @@ if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt") endif() enable_testing() - add_subdirectory(test) + add_subdirectory(test EXCLUDE_FROM_ALL) endif() diff --git a/test/policies/CMakeLists.txt b/test/policies/CMakeLists.txt index 8af727d7b..c73565a3b 100644 --- a/test/policies/CMakeLists.txt +++ b/test/policies/CMakeLists.txt @@ -6,7 +6,6 @@ foreach(item IN ITEMS compare - rescale_policy ) boost_geometry_add_unit_test("policies" ${item}) endforeach() From a6f99e5572d0b29bb403cf789e5454bc3074987a Mon Sep 17 00:00:00 2001 From: Vissarion Fisikopoulos Date: Sat, 10 Aug 2024 15:00:07 +0300 Subject: [PATCH 2/9] Add cmake tests on github actions and add cmake scripts for index --- .github/workflows/cmake.yml | 104 +++++++++++++++++++++++++++ CMakeLists.txt | 1 + index/test/CMakeLists.txt | 17 +++++ index/test/algorithms/CMakeLists.txt | 19 +++++ index/test/rtree/CMakeLists.txt | 19 +++++ test/CMakeLists.txt | 11 +-- 6 files changed, 166 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/cmake.yml create mode 100644 index/test/CMakeLists.txt create mode 100644 index/test/algorithms/CMakeLists.txt create mode 100644 index/test/rtree/CMakeLists.txt diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml new file mode 100644 index 000000000..223ce3efb --- /dev/null +++ b/.github/workflows/cmake.yml @@ -0,0 +1,104 @@ +############################################################################## +# GitHub Actions Workflow for Boost.Geometry to build tests with cmake +# +# Copyright (c) 2024 Oracle and/or its affiliates. +# Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle +# +# Use, modification and distribution is subject to the Boost Software License, +# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) +############################################################################## +name: cmake + +on: [push] + +jobs: + ############################################################################## + clang: + name: ${{ matrix.b2_toolset }} + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + b2_toolset: [ + clang-14 + ] + + include: + - b2_toolset: clang-14 + b2_cxxstd: 14,17,2a + version: "14" + os: ubuntu-22.04 + steps: + - name: Set up environment + id: setenv + run: | + if [[ "$GITHUB_REF" == *master ]]; then + echo "BOOST_BRANCH=master" >> $GITHUB_ENV + else + echo "BOOST_BRANCH=develop" >> $GITHUB_ENV + fi + echo "BOOST_SELF=$(basename $GITHUB_WORKSPACE)" >> $GITHUB_ENV + echo "BOOST_ROOT=$GITHUB_WORKSPACE/boost-root" >> $GITHUB_ENV + echo "boost_self=$(basename $GITHUB_WORKSPACE)" >> "$GITHUB_OUTPUT" + echo "boost_root=$GITHUB_WORKSPACE/boost-root" >> "$GITHUB_OUTPUT" + + - name: Clone boostorg/boost + run: | + git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git $BOOST_ROOT + cd $BOOST_ROOT + git submodule update -q --init libs/headers + git submodule update -q --init tools/boost_install + git submodule update -q --init tools/boostdep + git submodule update -q --init tools/build + mkdir -p libs/$BOOST_SELF + + - uses: actions/checkout@v2 + with: + path: ${{ steps.setenv.outputs.boost_root }}/libs/${{ steps.setenv.outputs.boost_self }} + + - name: Run tools/boostdep/depinst/depinst.py + run: | + cd $BOOST_ROOT + python tools/boostdep/depinst/depinst.py --include benchmark --include example --include examples --include tools $BOOST_SELF + + - name: Bootstrap boostorg/boost + run: | + gcc --version + cd $BOOST_ROOT + ./bootstrap.sh --with-toolset=gcc + ./b2 headers + test -f /usr/local/bin/b2 && rm -rf /usr/local/bin/b2 + test -f /usr/local/bin/bjam && rm -rf /usr/local/bin/bjam + sudo cp $BOOST_ROOT/b2 /usr/local/bin/ + ls -l /usr/local/bin/b2 + b2 -v + + - name: Set up clang toolset in ~/user-config.jam + run: | + export CXX_NAME=clang++-${{ matrix.version }} + echo ${CXX_NAME} + echo "# $HOME/user-config.jam" > $HOME/user-config.jam + echo "using clang : : $(which clang++-${{ matrix.version }}) ;" > ${HOME}/user-config.jam + test -f $HOME/user-config.jam && cat $HOME/user-config.jam + + - name: Build tests with cmake (c++17) + run: | + cd $BOOST_ROOT/libs/geometry + mkdir __build + cd __build + cmake -DCMAKE_CXX_STANDARD=17 -DBUILD_TESTING=ON .. + cmake --build . --target tests + + - name: Build tests with cmake + run: | + cd $BOOST_ROOT/libs/geometry/__build + rm -rf * + cmake -DBUILD_TESTING=ON .. + cmake --build . --target tests + + - name: Run tests + run: | + cd $BOOST_ROOT/libs/geometry/__build + ctest --output-on-failure --no-tests=error diff --git a/CMakeLists.txt b/CMakeLists.txt index 5da9cc9cf..dc0060255 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -124,6 +124,7 @@ if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt") enable_testing() add_subdirectory(test EXCLUDE_FROM_ALL) + add_subdirectory(index/test EXCLUDE_FROM_ALL) endif() diff --git a/index/test/CMakeLists.txt b/index/test/CMakeLists.txt new file mode 100644 index 000000000..755fcc47c --- /dev/null +++ b/index/test/CMakeLists.txt @@ -0,0 +1,17 @@ +# Boost.Geometry +# Copyright (c) 2024, Oracle and/or its affiliates. +# Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle +# Use, modification and distribution is subject to the Boost Software License, +# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +foreach(item IN ITEMS + minmax_heap + varray_old + varray + ) + boost_geometry_add_unit_test("index" ${item}) +endforeach() + +add_subdirectory(algorithms) +add_subdirectory(rtree) \ No newline at end of file diff --git a/index/test/algorithms/CMakeLists.txt b/index/test/algorithms/CMakeLists.txt new file mode 100644 index 000000000..15f808bb5 --- /dev/null +++ b/index/test/algorithms/CMakeLists.txt @@ -0,0 +1,19 @@ +# Boost.Geometry +# Copyright (c) 2024, Oracle and/or its affiliates. +# Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle +# Use, modification and distribution is subject to the Boost Software License, +# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +foreach(item IN ITEMS + content + intersection_content # this tests overlap() too + is_valid + margin + #minmaxdist + union_content + segment_intersection + path_intersection + ) + boost_geometry_add_unit_test("index" ${item}) +endforeach() \ No newline at end of file diff --git a/index/test/rtree/CMakeLists.txt b/index/test/rtree/CMakeLists.txt new file mode 100644 index 000000000..0df65b6b1 --- /dev/null +++ b/index/test/rtree/CMakeLists.txt @@ -0,0 +1,19 @@ +# Boost.Geometry +# Copyright (c) 2024, Oracle and/or its affiliates. +# Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle +# Use, modification and distribution is subject to the Boost Software License, +# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +foreach(item IN ITEMS + rtree_contains_point + rtree_epsilon + rtree_insert_remove + rtree_intersects_geom + rtree_move_pack + rtree_non_cartesian + rtree_values + #compile-fail rtree_values_invalid + ) + boost_geometry_add_unit_test("index" ${item}) +endforeach() \ No newline at end of file diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index e82943b54..110368542 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -8,26 +8,27 @@ # It also lets running the tests much faster. if (APPLE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffp-contract=fast") -endif() +endif() function(boost_geometry_add_unit_test prefix item) set(unit_test_name "boost_geometry_${prefix}_${item}") add_executable(${unit_test_name} ${item}.cpp) # Add a dependendcy to Boost.Geometry - target_link_libraries(${unit_test_name} + target_link_libraries(${unit_test_name} PRIVATE Boost::geometry) # For unit tests, add a dependency to the unit test framework (in header only mode) - target_link_libraries(${unit_test_name} + target_link_libraries(${unit_test_name} PRIVATE Boost::included_unit_test_framework) - + # Include the main Geometry test folder and the current folder target_include_directories(${unit_test_name} PRIVATE - "${PROJECT_SOURCE_DIR}/test" + "${PROJECT_SOURCE_DIR}/test" + "${PROJECT_SOURCE_DIR}/index/test" .) # To compile with C++14 From 16f9c637f4487f25bd21a9cc3585b37b126c91c8 Mon Sep 17 00:00:00 2001 From: Vissarion Fisikopoulos Date: Wed, 14 Aug 2024 13:35:12 +0300 Subject: [PATCH 3/9] Add cs_undefined to cmake tests and reorder add_subdirectory calls --- test/CMakeLists.txt | 24 +++++++++++++++++------- test/cs_undefined/CMakeLists.txt | 21 +++++++++++++++++++++ 2 files changed, 38 insertions(+), 7 deletions(-) create mode 100644 test/cs_undefined/CMakeLists.txt diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 110368542..77190ffb1 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,5 +1,12 @@ # Boost.Geometry + # Copyright (c) 2024 Barend Gehrels, Amsterdam, the Netherlands. + +# This file was modified by Oracle on 2024. +# Modifications copyright (c) 2024 Oracle and/or its affiliates. + +# Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle + # Use, modification and distribution is subject to the Boost Software License, # Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) @@ -48,16 +55,19 @@ if (NOT TARGET tests) add_custom_target(tests) endif() -add_subdirectory(core) -add_subdirectory(concepts) -add_subdirectory(geometries) -add_subdirectory(arithmetic) add_subdirectory(algorithms) +add_subdirectory(arithmetic) +add_subdirectory(concepts) +add_subdirectory(core) +add_subdirectory(cs_undefined) add_subdirectory(formulas) -add_subdirectory(iterators) -add_subdirectory(strategies) -add_subdirectory(policies) +add_subdirectory(geometries) add_subdirectory(io) +add_subdirectory(iterators) +add_subdirectory(policies) + add_subdirectory(srs) +add_subdirectory(strategies) + add_subdirectory(util) add_subdirectory(views) diff --git a/test/cs_undefined/CMakeLists.txt b/test/cs_undefined/CMakeLists.txt new file mode 100644 index 000000000..e6846f165 --- /dev/null +++ b/test/cs_undefined/CMakeLists.txt @@ -0,0 +1,21 @@ +# Boost.Geometry +# Copyright (c) 2024, Oracle and/or its affiliates. +# Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle +# Use, modification and distribution is subject to the Boost Software License, +# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +foreach(item IN ITEMS + distance + envelope_expand + index + is + measure + other + relops1 + relops2 + setops1 + setops2 + ) + boost_geometry_add_unit_test("cs_undefined" ${item}) +endforeach() \ No newline at end of file From 2c7301aae675560d88ddc35e29c269ce4f736fbb Mon Sep 17 00:00:00 2001 From: Vissarion Fisikopoulos Date: Wed, 14 Aug 2024 13:54:29 +0300 Subject: [PATCH 4/9] Adding robustness cmake test --- test/CMakeLists.txt | 3 +-- test/robustness/CMakeLists.txt | 10 ++++++++++ test/robustness/convex_hull/CMakeLists.txt | 12 +++++++++++ test/robustness/overlay/CMakeLists.txt | 10 ++++++++++ .../overlay/areal_areal/CMakeLists.txt | 20 +++++++++++++++++++ test/robustness/overlay/buffer/CMakeLists.txt | 14 +++++++++++++ .../overlay/linear_areal/CMakeLists.txt | 8 ++++++++ 7 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 test/robustness/CMakeLists.txt create mode 100644 test/robustness/convex_hull/CMakeLists.txt create mode 100644 test/robustness/overlay/CMakeLists.txt create mode 100644 test/robustness/overlay/areal_areal/CMakeLists.txt create mode 100644 test/robustness/overlay/buffer/CMakeLists.txt create mode 100644 test/robustness/overlay/linear_areal/CMakeLists.txt diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 77190ffb1..26bf184cb 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -65,9 +65,8 @@ add_subdirectory(geometries) add_subdirectory(io) add_subdirectory(iterators) add_subdirectory(policies) - +add_subdirectory(robustness) add_subdirectory(srs) add_subdirectory(strategies) - add_subdirectory(util) add_subdirectory(views) diff --git a/test/robustness/CMakeLists.txt b/test/robustness/CMakeLists.txt new file mode 100644 index 000000000..6b4a56f4e --- /dev/null +++ b/test/robustness/CMakeLists.txt @@ -0,0 +1,10 @@ +# Boost.Geometry +# Copyright (c) 2024, Oracle and/or its affiliates. +# Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle +# Use, modification and distribution is subject to the Boost Software License, +# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +add_subdirectory(convex_hull) +add_subdirectory(overlay) +#add_subdirectory(within) \ No newline at end of file diff --git a/test/robustness/convex_hull/CMakeLists.txt b/test/robustness/convex_hull/CMakeLists.txt new file mode 100644 index 000000000..f47b895ec --- /dev/null +++ b/test/robustness/convex_hull/CMakeLists.txt @@ -0,0 +1,12 @@ +# Boost.Geometry +# Copyright (c) 2024, Oracle and/or its affiliates. +# Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle +# Use, modification and distribution is subject to the Boost Software License, +# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +foreach(item IN ITEMS + random_multi_points + ) + boost_geometry_add_unit_test("robustness" ${item}) +endforeach() \ No newline at end of file diff --git a/test/robustness/overlay/CMakeLists.txt b/test/robustness/overlay/CMakeLists.txt new file mode 100644 index 000000000..cbe25c9e7 --- /dev/null +++ b/test/robustness/overlay/CMakeLists.txt @@ -0,0 +1,10 @@ +# Boost.Geometry +# Copyright (c) 2024, Oracle and/or its affiliates. +# Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle +# Use, modification and distribution is subject to the Boost Software License, +# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +add_subdirectory(areal_areal) +add_subdirectory(buffer) +add_subdirectory(linear_areal) \ No newline at end of file diff --git a/test/robustness/overlay/areal_areal/CMakeLists.txt b/test/robustness/overlay/areal_areal/CMakeLists.txt new file mode 100644 index 000000000..1ae004252 --- /dev/null +++ b/test/robustness/overlay/areal_areal/CMakeLists.txt @@ -0,0 +1,20 @@ +# Boost.Geometry +# Copyright (c) 2024, Oracle and/or its affiliates. +# Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle +# Use, modification and distribution is subject to the Boost Software License, +# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +foreach(item IN ITEMS + general_intersection_precision + interior_triangles + intersection_pies + intersection_stars + intersects + random_ellipses_stars + recursive_polygons + star_comb + ticket_9081 + ) + boost_geometry_add_unit_test("robustness" ${item}) +endforeach() \ No newline at end of file diff --git a/test/robustness/overlay/buffer/CMakeLists.txt b/test/robustness/overlay/buffer/CMakeLists.txt new file mode 100644 index 000000000..92b0ec391 --- /dev/null +++ b/test/robustness/overlay/buffer/CMakeLists.txt @@ -0,0 +1,14 @@ +# Boost.Geometry +# Copyright (c) 2024, Oracle and/or its affiliates. +# Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle +# Use, modification and distribution is subject to the Boost Software License, +# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +foreach(item IN ITEMS + many_ring_buffer + multi_point_growth + recursive_polygons_buffer + ) + boost_geometry_add_unit_test("robustness" ${item}) +endforeach() \ No newline at end of file diff --git a/test/robustness/overlay/linear_areal/CMakeLists.txt b/test/robustness/overlay/linear_areal/CMakeLists.txt new file mode 100644 index 000000000..fc3cfa220 --- /dev/null +++ b/test/robustness/overlay/linear_areal/CMakeLists.txt @@ -0,0 +1,8 @@ +# Boost.Geometry +# Copyright (c) 2024, Oracle and/or its affiliates. +# Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle +# Use, modification and distribution is subject to the Boost Software License, +# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +boost_geometry_add_unit_test("robustness" recursive_polygons_linear_areal) \ No newline at end of file From d7745884fd8143e4bf6e41c1df8eacd7811cf937 Mon Sep 17 00:00:00 2001 From: Vissarion Fisikopoulos Date: Wed, 14 Aug 2024 15:03:28 +0300 Subject: [PATCH 5/9] Add missing newlines at end of files --- index/test/CMakeLists.txt | 2 +- index/test/algorithms/CMakeLists.txt | 2 +- index/test/rtree/CMakeLists.txt | 2 +- test/cs_undefined/CMakeLists.txt | 2 +- test/robustness/CMakeLists.txt | 2 +- test/robustness/convex_hull/CMakeLists.txt | 2 +- test/robustness/overlay/CMakeLists.txt | 2 +- test/robustness/overlay/areal_areal/CMakeLists.txt | 2 +- test/robustness/overlay/buffer/CMakeLists.txt | 2 +- test/robustness/overlay/linear_areal/CMakeLists.txt | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/index/test/CMakeLists.txt b/index/test/CMakeLists.txt index 755fcc47c..aa81b48f0 100644 --- a/index/test/CMakeLists.txt +++ b/index/test/CMakeLists.txt @@ -14,4 +14,4 @@ foreach(item IN ITEMS endforeach() add_subdirectory(algorithms) -add_subdirectory(rtree) \ No newline at end of file +add_subdirectory(rtree) diff --git a/index/test/algorithms/CMakeLists.txt b/index/test/algorithms/CMakeLists.txt index 15f808bb5..410138a23 100644 --- a/index/test/algorithms/CMakeLists.txt +++ b/index/test/algorithms/CMakeLists.txt @@ -16,4 +16,4 @@ foreach(item IN ITEMS path_intersection ) boost_geometry_add_unit_test("index" ${item}) -endforeach() \ No newline at end of file +endforeach() diff --git a/index/test/rtree/CMakeLists.txt b/index/test/rtree/CMakeLists.txt index 0df65b6b1..5c09204f9 100644 --- a/index/test/rtree/CMakeLists.txt +++ b/index/test/rtree/CMakeLists.txt @@ -16,4 +16,4 @@ foreach(item IN ITEMS #compile-fail rtree_values_invalid ) boost_geometry_add_unit_test("index" ${item}) -endforeach() \ No newline at end of file +endforeach() diff --git a/test/cs_undefined/CMakeLists.txt b/test/cs_undefined/CMakeLists.txt index e6846f165..f4110499f 100644 --- a/test/cs_undefined/CMakeLists.txt +++ b/test/cs_undefined/CMakeLists.txt @@ -18,4 +18,4 @@ foreach(item IN ITEMS setops2 ) boost_geometry_add_unit_test("cs_undefined" ${item}) -endforeach() \ No newline at end of file +endforeach() diff --git a/test/robustness/CMakeLists.txt b/test/robustness/CMakeLists.txt index 6b4a56f4e..9ad40d9f2 100644 --- a/test/robustness/CMakeLists.txt +++ b/test/robustness/CMakeLists.txt @@ -7,4 +7,4 @@ add_subdirectory(convex_hull) add_subdirectory(overlay) -#add_subdirectory(within) \ No newline at end of file +#add_subdirectory(within) diff --git a/test/robustness/convex_hull/CMakeLists.txt b/test/robustness/convex_hull/CMakeLists.txt index f47b895ec..a3fc51420 100644 --- a/test/robustness/convex_hull/CMakeLists.txt +++ b/test/robustness/convex_hull/CMakeLists.txt @@ -9,4 +9,4 @@ foreach(item IN ITEMS random_multi_points ) boost_geometry_add_unit_test("robustness" ${item}) -endforeach() \ No newline at end of file +endforeach() diff --git a/test/robustness/overlay/CMakeLists.txt b/test/robustness/overlay/CMakeLists.txt index cbe25c9e7..5cd93c834 100644 --- a/test/robustness/overlay/CMakeLists.txt +++ b/test/robustness/overlay/CMakeLists.txt @@ -7,4 +7,4 @@ add_subdirectory(areal_areal) add_subdirectory(buffer) -add_subdirectory(linear_areal) \ No newline at end of file +add_subdirectory(linear_areal) diff --git a/test/robustness/overlay/areal_areal/CMakeLists.txt b/test/robustness/overlay/areal_areal/CMakeLists.txt index 1ae004252..9f39d7221 100644 --- a/test/robustness/overlay/areal_areal/CMakeLists.txt +++ b/test/robustness/overlay/areal_areal/CMakeLists.txt @@ -17,4 +17,4 @@ foreach(item IN ITEMS ticket_9081 ) boost_geometry_add_unit_test("robustness" ${item}) -endforeach() \ No newline at end of file +endforeach() diff --git a/test/robustness/overlay/buffer/CMakeLists.txt b/test/robustness/overlay/buffer/CMakeLists.txt index 92b0ec391..a0d15fc94 100644 --- a/test/robustness/overlay/buffer/CMakeLists.txt +++ b/test/robustness/overlay/buffer/CMakeLists.txt @@ -11,4 +11,4 @@ foreach(item IN ITEMS recursive_polygons_buffer ) boost_geometry_add_unit_test("robustness" ${item}) -endforeach() \ No newline at end of file +endforeach() diff --git a/test/robustness/overlay/linear_areal/CMakeLists.txt b/test/robustness/overlay/linear_areal/CMakeLists.txt index fc3cfa220..eef2de6be 100644 --- a/test/robustness/overlay/linear_areal/CMakeLists.txt +++ b/test/robustness/overlay/linear_areal/CMakeLists.txt @@ -5,4 +5,4 @@ # Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) -boost_geometry_add_unit_test("robustness" recursive_polygons_linear_areal) \ No newline at end of file +boost_geometry_add_unit_test("robustness" recursive_polygons_linear_areal) From fbd158a7ea6fe3b52ad297f73029c183f5691fdf Mon Sep 17 00:00:00 2001 From: Vissarion Fisikopoulos Date: Wed, 14 Aug 2024 16:06:38 +0300 Subject: [PATCH 6/9] Fix cmake robustness tests --- CMakeLists.txt | 4 ++++ test/robustness/convex_hull/CMakeLists.txt | 11 ++++++----- test/robustness/overlay/areal_areal/CMakeLists.txt | 8 ++++++-- test/robustness/overlay/buffer/CMakeLists.txt | 8 ++++++-- 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dc0060255..750938c0a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,6 +24,7 @@ target_link_libraries(boost_geometry Boost::concept_check Boost::config Boost::core + Boost::crc Boost::function_types Boost::iterator Boost::lexical_cast @@ -32,6 +33,7 @@ target_link_libraries(boost_geometry Boost::mpl Boost::multiprecision Boost::numeric_conversion + Boost::program_options Boost::qvm Boost::range Boost::rational @@ -100,9 +102,11 @@ if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt") config algorithm any + crc lexical_cast math multiprecision + program_options qvm rational serialization diff --git a/test/robustness/convex_hull/CMakeLists.txt b/test/robustness/convex_hull/CMakeLists.txt index a3fc51420..09392259d 100644 --- a/test/robustness/convex_hull/CMakeLists.txt +++ b/test/robustness/convex_hull/CMakeLists.txt @@ -5,8 +5,9 @@ # Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) -foreach(item IN ITEMS - random_multi_points - ) - boost_geometry_add_unit_test("robustness" ${item}) -endforeach() +boost_geometry_add_unit_test("robustness" random_multi_points) + +target_include_directories(boost_geometry_robustness_random_multi_points + PRIVATE + "${PROJECT_SOURCE_DIR}/test/robustness" + .) diff --git a/test/robustness/overlay/areal_areal/CMakeLists.txt b/test/robustness/overlay/areal_areal/CMakeLists.txt index 9f39d7221..5c2c0ed62 100644 --- a/test/robustness/overlay/areal_areal/CMakeLists.txt +++ b/test/robustness/overlay/areal_areal/CMakeLists.txt @@ -6,7 +6,7 @@ # http://www.boost.org/LICENSE_1_0.txt) foreach(item IN ITEMS - general_intersection_precision + #general_intersection_precision interior_triangles intersection_pies intersection_stars @@ -14,7 +14,11 @@ foreach(item IN ITEMS random_ellipses_stars recursive_polygons star_comb - ticket_9081 + #ticket_9081 ) boost_geometry_add_unit_test("robustness" ${item}) + target_include_directories(boost_geometry_robustness_${item} + PRIVATE + "${PROJECT_SOURCE_DIR}/test/robustness" + .) endforeach() diff --git a/test/robustness/overlay/buffer/CMakeLists.txt b/test/robustness/overlay/buffer/CMakeLists.txt index a0d15fc94..c45812a11 100644 --- a/test/robustness/overlay/buffer/CMakeLists.txt +++ b/test/robustness/overlay/buffer/CMakeLists.txt @@ -6,9 +6,13 @@ # http://www.boost.org/LICENSE_1_0.txt) foreach(item IN ITEMS - many_ring_buffer - multi_point_growth + #many_ring_buffer + #multi_point_growth recursive_polygons_buffer ) boost_geometry_add_unit_test("robustness" ${item}) + target_include_directories(boost_geometry_robustness_${item} + PRIVATE + "${PROJECT_SOURCE_DIR}/test/robustness" + .) endforeach() From e45fa580ee621544df2bad634f80816dfa4db1ca Mon Sep 17 00:00:00 2001 From: Vissarion Fisikopoulos Date: Wed, 14 Aug 2024 23:54:17 +0300 Subject: [PATCH 7/9] Exclude some tests from runnig with ctest (only compile them) --- test/CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 26bf184cb..71ad12292 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -21,7 +21,7 @@ function(boost_geometry_add_unit_test prefix item) set(unit_test_name "boost_geometry_${prefix}_${item}") add_executable(${unit_test_name} ${item}.cpp) - # Add a dependendcy to Boost.Geometry + # Add a dependency to Boost.Geometry target_link_libraries(${unit_test_name} PRIVATE Boost::geometry) @@ -42,7 +42,10 @@ function(boost_geometry_add_unit_test prefix item) target_compile_features(${unit_test_name} PRIVATE cxx_std_14) # To be able to run ctest - add_test(NAME ${unit_test_name} COMMAND ${unit_test_name}) + 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 a dependency to the global tests target add_dependencies(tests ${unit_test_name}) From 1dea69dc6bcef9a9c4c08efe43ee0e17490c50ee Mon Sep 17 00:00:00 2001 From: Vissarion Fisikopoulos Date: Thu, 5 Sep 2024 16:17:21 +0300 Subject: [PATCH 8/9] [cmake] Add optional variable to boost_geometry_add_unit_test --- test/CMakeLists.txt | 5 +++-- test/cs_undefined/CMakeLists.txt | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 71ad12292..3836548f7 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -42,8 +42,8 @@ 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")) + set(extra_macro_args ${ARGN}) + if (NOT extra_macro_args STREQUAL "not_run") add_test(NAME ${unit_test_name} COMMAND ${unit_test_name}) endif() @@ -52,6 +52,7 @@ function(boost_geometry_add_unit_test prefix item) # 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) + endfunction() if (NOT TARGET tests) diff --git a/test/cs_undefined/CMakeLists.txt b/test/cs_undefined/CMakeLists.txt index f4110499f..88a2dddb2 100644 --- a/test/cs_undefined/CMakeLists.txt +++ b/test/cs_undefined/CMakeLists.txt @@ -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") From 3dc7768ea665777dd4eb96f0ea59874acc8b01cc Mon Sep 17 00:00:00 2001 From: Vissarion Fisikopoulos Date: Thu, 5 Sep 2024 16:25:41 +0300 Subject: [PATCH 9/9] [cmake] Use BOOST_GEOMETRY_UNIT_TEST_NAME in target_compile_definitions --- test/robustness/overlay/areal_areal/CMakeLists.txt | 2 +- test/robustness/overlay/buffer/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/robustness/overlay/areal_areal/CMakeLists.txt b/test/robustness/overlay/areal_areal/CMakeLists.txt index 5c2c0ed62..f01e7c688 100644 --- a/test/robustness/overlay/areal_areal/CMakeLists.txt +++ b/test/robustness/overlay/areal_areal/CMakeLists.txt @@ -17,7 +17,7 @@ foreach(item IN ITEMS #ticket_9081 ) boost_geometry_add_unit_test("robustness" ${item}) - target_include_directories(boost_geometry_robustness_${item} + target_include_directories(${BOOST_GEOMETRY_UNIT_TEST_NAME} PRIVATE "${PROJECT_SOURCE_DIR}/test/robustness" .) diff --git a/test/robustness/overlay/buffer/CMakeLists.txt b/test/robustness/overlay/buffer/CMakeLists.txt index c45812a11..23b109581 100644 --- a/test/robustness/overlay/buffer/CMakeLists.txt +++ b/test/robustness/overlay/buffer/CMakeLists.txt @@ -11,7 +11,7 @@ foreach(item IN ITEMS recursive_polygons_buffer ) boost_geometry_add_unit_test("robustness" ${item}) - target_include_directories(boost_geometry_robustness_${item} + target_include_directories(${BOOST_GEOMETRY_UNIT_TEST_NAME} PRIVATE "${PROJECT_SOURCE_DIR}/test/robustness" .)