diff --git a/Polyhedron/demo/Polyhedron/CMakeLists.txt b/Polyhedron/demo/Polyhedron/CMakeLists.txt index b8b72aa7939..100d0948c14 100644 --- a/Polyhedron/demo/Polyhedron/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/CMakeLists.txt @@ -217,7 +217,7 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) STATUS "Qt5WebSockets was found. Using WebSockets is therefore possible.") endif() - cgal_add_compilation_test(demo_framework) + #compilation_of__demo_framework is defined in polyhedron_demo_macros.cmake # Let's define `three_EXPORT` during the compilation of `demo_framework`, # in addition of `demo_framework_EXPORT` (defined automatically by # CMake). That is to deal with the visibility of symbols of diff --git a/Polyhedron/demo/Polyhedron/Plugins/Camera_position/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Camera_position/CMakeLists.txt index d3d02304559..c4ac0436112 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Camera_position/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Camera_position/CMakeLists.txt @@ -7,5 +7,7 @@ polyhedron_demo_plugin(camera_positions_plugin ${cameraUI_FILES} KEYWORDS Viewer) +add_dependencies(camera_positions_plugin demo_framework) target_link_libraries( camera_positions_plugin PUBLIC demo_framework) target_link_libraries(camera_positions_plugin PUBLIC demo_framework) + diff --git a/Polyhedron/demo/Polyhedron/Plugins/Classification/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Classification/CMakeLists.txt index 7310bbee3b6..5ad7e8b16ef 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Classification/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Classification/CMakeLists.txt @@ -47,6 +47,12 @@ if(TARGET CGAL::Eigen3_support) scene_color_ramp CGAL::Eigen3_support) + if(BUILD_TESTING) + set_tests_properties( + compilation_of__classification_plugin + PROPERTIES RESOURCE_LOCK Selection_test_resources) + endif() + if(TARGET CGAL::Boost_serialization_support AND TARGET CGAL::Boost_iostreams_support) target_link_libraries(classification_plugin PUBLIC CGAL::Boost_serialization_support diff --git a/Polyhedron/demo/Polyhedron/Plugins/Convex_hull/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Convex_hull/CMakeLists.txt index fa13f46ff54..c28045e0aa9 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Convex_hull/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Convex_hull/CMakeLists.txt @@ -8,3 +8,10 @@ target_link_libraries( polyhedron_demo_plugin(kernel_plugin Kernel_plugin) target_link_libraries(kernel_plugin PUBLIC scene_surface_mesh_item) + + +if(BUILD_TESTING) + set_tests_properties( + compilation_of__convex_hull_plugin + PROPERTIES RESOURCE_LOCK Selection_test_resources) +endif() diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/PCA/CMakeLists.txt index 58f1350a3dc..a27e53f67c9 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/CMakeLists.txt @@ -37,3 +37,9 @@ target_link_libraries( basic_generator_plugin PUBLIC scene_surface_mesh_item scene_points_with_normal_item scene_polylines_item) + + if(BUILD_TESTING) + set_tests_properties( + compilation_of__create_obb_mesh_plugin + PROPERTIES RESOURCE_LOCK Selection_test_resources) + endif() diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/PMP/CMakeLists.txt index 577c980c628..4a285de7181 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/CMakeLists.txt @@ -52,6 +52,18 @@ if(TARGET CGAL::Eigen3_support) DESCRIPTION "A large scale non-linear optimization library." PURPOSE "Can be used as a solver in the smoothing plugin.") target_link_libraries(extrude_plugin PUBLIC CGAL::Eigen3_support) + if(BUILD_TESTING) + set_tests_properties( + compilation_of__extrude_plugin + compilation_of__fairing_plugin + PROPERTIES RESOURCE_LOCK Selection_test_resources) + endif() + if(BUILD_TESTING) + set_tests_properties( + compilation_of__hole_filling_plugin + compilation_of__smoothing_plugin + PROPERTIES RESOURCE_LOCK Selection_test_resources) + endif() else() message( STATUS @@ -153,3 +165,16 @@ polyhedron_demo_plugin(engrave_text_plugin Engrave_text_plugin target_link_libraries( engrave_text_plugin PUBLIC scene_surface_mesh_item scene_selection_item scene_polylines_item) + + +if(BUILD_TESTING) + set_tests_properties( + compilation_of__join_and_split_plugin + compilation_of__selection_plugin + compilation_of__triangulate_facets_plugin + compilation_of__isotropic_remeshing_plugin + compilation_of__random_perturbation_plugin + compilation_of__engrave_text_plugin + compilation_of__degenerated_faces_plugin + PROPERTIES RESOURCE_LOCK Selection_test_resources) +endif() diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/CMakeLists.txt index 04002c3e067..baa99e5eeb2 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/CMakeLists.txt @@ -15,6 +15,12 @@ if(NOT CGAL_DISABLE_GMP) target_link_libraries( parameterization_plugin PUBLIC scene_surface_mesh_item scene_textured_item scene_selection_item CGAL::Eigen3_support) + if(BUILD_TESTING) + set_tests_properties( + compilation_of__parameterization_plugin + PROPERTIES RESOURCE_LOCK Selection_test_resources) + endif() + else() message( STATUS @@ -26,7 +32,11 @@ if(NOT CGAL_DISABLE_GMP) polyhedron_demo_plugin(mesh_segmentation_plugin Mesh_segmentation_plugin ${segmentationUI_FILES}) target_link_libraries(mesh_segmentation_plugin PUBLIC scene_surface_mesh_item) - + if(BUILD_TESTING) + set_tests_properties( + compilation_of__mesh_segmentation_plugin + PROPERTIES RESOURCE_LOCK Selection_test_resources) + endif() qt5_wrap_ui( mesh_simplificationUI_FILES Mesh_simplification_dialog.ui) polyhedron_demo_plugin(mesh_simplification_plugin Mesh_simplification_plugin ${mesh_simplificationUI_FILES}) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/CMakeLists.txt index b32cf6f7d7a..7cac6a10dd6 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/CMakeLists.txt @@ -9,4 +9,11 @@ else() STATUS "NOTICE: The polyhedron edit plugin require Eigen 3.2 (or higher) and will not be available." ) + +if(BUILD_TESTING) + set_tests_properties( + compilation_of__edit_plugin + PROPERTIES RESOURCE_LOCK Selection_test_resources) +endif() + endif() diff --git a/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake b/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake index d7927b1754f..49c97ab3f67 100644 --- a/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake +++ b/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake @@ -34,8 +34,27 @@ include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) # Link with the demo_framework if(TARGET demo_framework) target_link_libraries( ${plugin_name} PUBLIC demo_framework) + add_dependencies(${plugin_name} demo_framework) + if(BUILD_TESTING) + + if(NOT TARGET compilation_of__demo_framework) + # This custom target is useless. It is used only as a flag to + # detect that the test has already been created. + add_custom_target(compilation_of__demo_framework) + add_dependencies( compilation_of__demo_framework demo_framework ) + add_test(NAME "compilation_of__demo_framework" + COMMAND "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target "demo_framework" --config "$") + set_property(TEST "compilation_of__demo_framework" + APPEND PROPERTY LABELS "CGAL_build_system") + set_property(TEST "compilation_of__demo_framework" + PROPERTY FIXTURES_SETUP "check_build_system_SetupFixture") + set_property(TEST "compilation_of__demo_framework" + APPEND PROPERTY DEPENDS "compilation_of__CGAL_Qt5_moc_and_resources") + endif() + endif() else() target_link_libraries( ${plugin_name} PUBLIC Polyhedron_demo_framework) + add_dependencies(${plugin_name} Polyhedron_demo_framework) endif() # Link with CGAL target_link_libraries( ${plugin_name} PUBLIC ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} ) diff --git a/Scripts/developer_scripts/run_testsuite_with_ctest b/Scripts/developer_scripts/run_testsuite_with_ctest index 09046304318..bfca26d788b 100644 --- a/Scripts/developer_scripts/run_testsuite_with_ctest +++ b/Scripts/developer_scripts/run_testsuite_with_ctest @@ -258,7 +258,7 @@ run_test_on_platform() CGAL_BINARY_DIR=${CGAL_BINARY_DIR_BASE}/${PLATFORM} cd "${CGAL_BINARY_DIR}" log "${ACTUAL_LOGFILE}.test.${PLATFORM}" "Testing on host ${HOST} and platform ${PLATFORM}" - + if [ -f "${REFERENCE_PLATFORMS_DIR}/${PLATFORM}/setup" ]; then source "${REFERENCE_PLATFORMS_DIR}/${PLATFORM}/setup" else @@ -274,7 +274,7 @@ run_test_on_platform() CMAKE_OPTS="${CMAKE_OPTS} -DWITH_examples=ON -DWITH_demos=ON" fi if [ -z "${SHOW_PROGRESS}" ]; then - cmake ${INIT_FILE:+"-C${INIT_FILE}"} -DBUILD_TESTING=ON ${CMAKE_OPTS} $CGAL_DIR >package_installation.log 2>&1 + cmake ${INIT_FILE:+"-C${INIT_FILE}"} -DBUILD_TESTING=ON ${CMAKE_OPTS} $CGAL_DIR >package_installation.log 2>&1 else cmake ${INIT_FILE:+"-C${INIT_FILE}"} -DBUILD_TESTING=ON ${CMAKE_OPTS} $CGAL_DIR 2>&1 |tee package_installation.log fi @@ -294,14 +294,28 @@ run_test_on_platform() #unsets the limit of 1024 bits for the logs through ssh echo "SET(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 1000000000)" > CTestCustom.cmake echo "SET(CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE 1000000000)" >> CTestCustom.cmake - CTEST_OPTS="-T Start -T Test --timeout 1200 -j${NUMBER_OF_PROCESSORS} ${DO_NOT_TEST:+-E execution___of__} " + + CTEST_OPTS="-T Start -T Test --timeout 1200 ${DO_NOT_TEST:+-E execution___of__}" + FULL_OPTS=${CTEST_OPTS} + echo "NUMBER_OF_PROCESSORS = ${NUMBER_OF_PROCESSORS}" if uname | grep -q "CYGWIN"; then - CTEST_OPTS="-C ${CONFIG_TYPE} ${CTEST_OPTS} -V" + CTEST_OPTS="-C ${CONFIG_TYPE} ${CTEST_OPTS}" + FULL_OPTS="${CTEST_OPTS} -LE Polyhedron_Demo -V" fi if [ -z "${SHOW_PROGRESS}" ]; then - ctest ${TO_TEST:+-L ${TO_TEST} } ${CTEST_OPTS} ${KEEP_TESTS:+-FC .}> tmp.txt + ctest ${TO_TEST:+-L ${TO_TEST} } ${FULL_OPTS} -j${NUMBER_OF_PROCESSORS} ${KEEP_TESTS:+-FC .}> tmp.txt + if uname | grep -q "CYGWIN"; then + if [[ $TO_TEST == *"Polyhedron_Demo"* ]]; then + ctest ${CTEST_OPTS} -L Polyhedron_Demo ${KEEP_TESTS:+-FC .}>> tmp.txt + fi + fi else - ctest ${TO_TEST:+-L ${TO_TEST} } ${CTEST_OPTS} ${KEEP_TESTS:+-FC .} |tee tmp.txt + ctest ${TO_TEST:+-L ${TO_TEST} } -j${NUMBER_OF_PROCESSORS} ${FULL_OPTS} ${KEEP_TESTS:+-FC .} |tee tmp.txt + if uname | grep -q "CYGWIN"; then + if [[ $TO_TEST == *"Polyhedron_Demo"* ]]; then + ctest ${CTEST_OPTS} -L Polyhedron_Demo ${KEEP_TESTS:+-FC .} |tee -a tmp.txt + fi + fi fi ##################### ## GET RESULTS ## @@ -373,7 +387,7 @@ run_test_on_host() setup_dirs -# Setup cmake +# Setup cmake log "${ACTUAL_LOGFILE}" "running the testsuites" if [ -n "${CONSOLE_OUTPUT}" ]; then printf "\n-------------------------------------------------------\n"