summaryrefslogtreecommitdiff
path: root/src/Witness_complex
diff options
context:
space:
mode:
Diffstat (limited to 'src/Witness_complex')
-rw-r--r--src/Witness_complex/example/CMakeLists.txt30
-rw-r--r--src/Witness_complex/include/gudhi/Strong_witness_complex.h4
-rw-r--r--src/Witness_complex/include/gudhi/Witness_complex.h4
-rw-r--r--src/Witness_complex/test/CMakeLists.txt21
4 files changed, 19 insertions, 40 deletions
diff --git a/src/Witness_complex/example/CMakeLists.txt b/src/Witness_complex/example/CMakeLists.txt
index 549a85be..670651ce 100644
--- a/src/Witness_complex/example/CMakeLists.txt
+++ b/src/Witness_complex/example/CMakeLists.txt
@@ -6,7 +6,8 @@ target_link_libraries(Witness_complex_example_nearest_landmark_table ${Boost_SYS
if (TBB_FOUND)
target_link_libraries(Witness_complex_example_nearest_landmark_table ${TBB_LIBRARIES})
endif()
-add_test(Witness_complex_test_nearest_landmark_table Witness_complex_example_nearest_landmark_table)
+add_test(NAME Witness_complex_example_nearest_landmark_table
+ COMMAND $<TARGET_FILE:Witness_complex_example_nearest_landmark_table>)
# CGAL and Eigen3 are required for Euclidean version of Witness
if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0)
@@ -28,17 +29,18 @@ if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0)
target_link_libraries(Witness_complex_example_strong_witness_persistence ${TBB_LIBRARIES})
endif()
- add_test(Witness_complex_off_test_torus
- ${CMAKE_CURRENT_BINARY_DIR}/Witness_complex_example_off
- ${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off 20 1.0 3)
- add_test(Witness_complex_strong_off_test_torus
- ${CMAKE_CURRENT_BINARY_DIR}/Witness_complex_example_strong_off
- ${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off 20 1.0 3)
- add_test(Witness_complex_test_sphere_10 Witness_complex_example_sphere 10)
- add_test(Witness_complex_test_torus_persistence
- ${CMAKE_CURRENT_BINARY_DIR}/Witness_complex_example_witness_persistence
- ${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off -l 20 -a 0.5)
- add_test(Witness_complex_strong_test_torus_persistence
- ${CMAKE_CURRENT_BINARY_DIR}/Witness_complex_example_strong_witness_persistence
- ${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off -l 20 -a 0.5)
+ add_test(NAME Witness_complex_example_off_test_torus
+ COMMAND $<TARGET_FILE:Witness_complex_example_off>
+ "${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off" "20" "1.0" "3")
+ add_test(NAME Witness_complex_example_strong_off_test_torus
+ COMMAND $<TARGET_FILE:Witness_complex_example_strong_off>
+ "${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off" "20" "1.0" "3")
+ add_test(NAME Witness_complex_example_test_sphere_10
+ COMMAND $<TARGET_FILE:Witness_complex_example_sphere> "10")
+ add_test(NAME Witness_complex_example_test_torus_persistence
+ COMMAND $<TARGET_FILE:Witness_complex_example_witness_persistence>
+ "${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off" "-l" "20" "-a" "0.5")
+ add_test(NAME Witness_complex_example_strong_test_torus_persistence
+ COMMAND $<TARGET_FILE:Witness_complex_example_strong_witness_persistence>
+ "${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off" "-l" "20" "-a" "0.5")
endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0)
diff --git a/src/Witness_complex/include/gudhi/Strong_witness_complex.h b/src/Witness_complex/include/gudhi/Strong_witness_complex.h
index a973ddb7..6f4bcf60 100644
--- a/src/Witness_complex/include/gudhi/Strong_witness_complex.h
+++ b/src/Witness_complex/include/gudhi/Strong_witness_complex.h
@@ -105,10 +105,6 @@ class Strong_witness_complex {
<< "non-negative.\n";
return false;
}
- if (limit_dimension < 0) {
- std::cerr << "Strong witness complex cannot create complex - limit dimension must be non-negative.\n";
- return false;
- }
for (auto w : nearest_landmark_table_) {
ActiveWitness aw(w);
typeVectorVertex simplex;
diff --git a/src/Witness_complex/include/gudhi/Witness_complex.h b/src/Witness_complex/include/gudhi/Witness_complex.h
index 63f03687..bcfe8484 100644
--- a/src/Witness_complex/include/gudhi/Witness_complex.h
+++ b/src/Witness_complex/include/gudhi/Witness_complex.h
@@ -106,10 +106,6 @@ class Witness_complex {
std::cerr << "Witness complex cannot create complex - squared relaxation parameter must be non-negative.\n";
return false;
}
- if (limit_dimension < 0) {
- std::cerr << "Witness complex cannot create complex - limit dimension must be non-negative.\n";
- return false;
- }
ActiveWitnessList active_witnesses;
Landmark_id k = 0; /* current dimension in iterative construction */
for (auto w : nearest_landmark_table_)
diff --git a/src/Witness_complex/test/CMakeLists.txt b/src/Witness_complex/test/CMakeLists.txt
index e73f9c3a..152e2f2c 100644
--- a/src/Witness_complex/test/CMakeLists.txt
+++ b/src/Witness_complex/test/CMakeLists.txt
@@ -1,14 +1,7 @@
cmake_minimum_required(VERSION 2.6)
project(Witness_complex_tests)
-if (GCOVR_PATH)
- # for gcovr to make coverage reports - Corbera Jenkins plugin
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
-endif()
-if (GPROF_PATH)
- # for gprof to make coverage reports - Jenkins
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg")
-endif()
+include(GUDHI_test_coverage)
add_executable ( Witness_complex_test_simple_witness_complex test_simple_witness_complex.cpp )
target_link_libraries(Witness_complex_test_simple_witness_complex ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
@@ -16,11 +9,7 @@ if (TBB_FOUND)
target_link_libraries(Witness_complex_test_simple_witness_complex ${TBB_LIBRARIES})
endif(TBB_FOUND)
-# Unitary tests definition and xml result file generation
-add_test(NAME simple_witness_complex
- COMMAND ${CMAKE_CURRENT_BINARY_DIR}/Witness_complex_test_simple_witness_complex
- # XML format for Jenkins xUnit plugin
- --log_format=XML --log_sink=${CMAKE_SOURCE_DIR}/Witness_complex_test_simple_witness_complexUT.xml --log_level=test_suite --report_level=no)
+gudhi_add_coverage_test(Witness_complex_test_simple_witness_complex)
# CGAL and Eigen3 are required for Euclidean version of Witness
if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0)
@@ -30,9 +19,5 @@ if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0)
target_link_libraries(Witness_complex_test_euclidean_simple_witness_complex ${TBB_LIBRARIES})
endif(TBB_FOUND)
- # Unitary tests definition and xml result file generation
- add_test(NAME euclidean_simple_witness_complex
- COMMAND ${CMAKE_CURRENT_BINARY_DIR}/Witness_complex_test_euclidean_simple_witness_complex
- # XML format for Jenkins xUnit plugin
- --log_format=XML --log_sink=${CMAKE_SOURCE_DIR}/Witness_complex_test_euclidean_simple_witness_complexUT.xml --log_level=test_suite --report_level=no)
+ gudhi_add_coverage_test(Witness_complex_test_euclidean_simple_witness_complex)
endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0)