From 8e83a86b147987cc256812aff78335ac8a26c36e Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Mon, 15 Dec 2014 16:56:31 +0000 Subject: CMakeLists.txt uniformization. check_google_style bug fix. generate_version copy Doxyfile git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/cpplint_test@352 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: a64f89b97ff3acbcf562070cc59b6065013d4aa1 --- CMakeLists.txt | 14 +++++++++++++- scripts/check_google_style.sh | 3 ++- scripts/generate_version.sh | 1 + src/CMakeLists.txt | 6 ++++-- src/Contraction/test/CMakeLists.txt | 14 ++++++++++++++ .../example/performance_rips_persistence.cpp | 1 + .../example/rips_multifield_persistence.cpp | 1 + src/Persistent_cohomology/example/rips_persistence.cpp | 1 + .../example/rips_persistence_from_alpha_shape_3.cpp | 1 + .../include/gudhi/Persistent_cohomology.h | 5 +++++ .../include/gudhi/Persistent_cohomology/Field_Zp.h | 4 ++++ .../include/gudhi/Persistent_cohomology/Multi_field.h | 4 ++++ .../Persistent_cohomology/Persistent_cohomology_column.h | 4 ++++ src/Persistent_cohomology/test/CMakeLists.txt | 8 +------- .../test/persistent_cohomology_unit_test.cpp | 1 + .../test/persistent_cohomology_unit_test_multi_field.cpp | 1 + src/Simplex_tree/example/CMakeLists.txt | 6 +++--- .../include/gudhi/Simplex_tree/Simplex_tree_siblings.h | 16 +++++++++------- src/Simplex_tree/test/CMakeLists.txt | 9 +-------- src/Skeleton_blocker/test/CMakeLists.txt | 13 +++++++++++++ 20 files changed, 84 insertions(+), 29 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ac31ab7e..eeb5a889 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,7 @@ if(MSVC) # Turn off some VC++ warnings SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267 /wd4668 /wd4311 /wd4800 /wd4820 /wd4503 /wd4244 /wd4345 /wd4996 /wd4396 /wd4018") else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -std=c++11 -Wall -Wpedantic -lboost_system -lboost_timer -lboost_unit_test_framework -lgmpxx -lgmp") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -std=c++11 -Wall -Wpedantic") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -O0") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") endif() @@ -38,6 +38,18 @@ if (PYTHON_PATH) message("python found in ${PYTHON_PATH}") endif() +# Function to add_test cpplint on each header file of the Gudhi module +function(cpplint_add_tests the_directory) + if (PYTHON_PATH) + # Cpplint tests on coding style + file(GLOB files "${the_directory}/*.h" "${the_directory}/*/*.h") + foreach(filename ${files}) + message(${filename}) + add_test("${filename}.cpplint" ${CMAKE_SOURCE_DIR}/scripts/check_google_style.sh ${filename} ${CMAKE_SOURCE_DIR}/scripts/cpplint.py) + endforeach() + endif() +endfunction(cpplint_add_tests) + if(NOT Boost_FOUND) message(FATAL_ERROR "NOTICE: This demo requires Boost and will not be compiled.") diff --git a/scripts/check_google_style.sh b/scripts/check_google_style.sh index fc659346..9ed5cad0 100755 --- a/scripts/check_google_style.sh +++ b/scripts/check_google_style.sh @@ -4,6 +4,7 @@ # VERSION CHECK ROOT_DIR=.. FILE_TO_CHECK="$1" +PYTHON_SCRIPT="$2" LOG_FILE=$FILE_TO_CHECK.cpplint if [ -f $LOG_FILE ]; then @@ -17,7 +18,7 @@ fi # CPPLINT FILE echo "File: $FILE_TO_CHECK" 2>&1 | tee -a $LOG_FILE -python ~/cpplint.py --linelength=120 $FILE_TO_CHECK 2>&1 | tee -a $LOG_FILE +python $PYTHON_SCRIPT --linelength=120 $FILE_TO_CHECK 2>&1 | tee -a $LOG_FILE LINE_ERRORS=`grep "Total errors found:" $LOG_FILE` NB_ERRORS=${LINE_ERRORS:20} diff --git a/scripts/generate_version.sh b/scripts/generate_version.sh index 4b5d08f4..1a8ce4ab 100644 --- a/scripts/generate_version.sh +++ b/scripts/generate_version.sh @@ -47,6 +47,7 @@ cp $ROOT_DIR/Conventions.txt $VERSION_DIR cp $ROOT_DIR/COPYING $VERSION_DIR cp -R $ROOT_DIR/data $VERSION_DIR cp $ROOT_DIR/src/CMakeLists.txt $VERSION_DIR +cp $ROOT_DIR/src/Doxyfile $VERSION_DIR # PACKAGE LEVEL COPY PACKAGE_INC_DIR="/include" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 876d7fa6..04773b0a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,17 +2,19 @@ cmake_minimum_required(VERSION 2.6) project(GUDHI) -find_package(Boost REQUIRED COMPONENTS system filesystem unit_test_framework chrono timer REQUIRED) +find_package(Boost REQUIRED COMPONENTS system filesystem program_options chrono timer REQUIRED) if(MSVC) # Turn off some VC++ warnings SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267 /wd4668 /wd4311 /wd4800 /wd4820 /wd4503 /wd4244 /wd4345 /wd4996 /wd4396 /wd4018") else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -std=c++11 -Wall -Wpedantic -lboost_system -lgmpxx -lgmp") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -std=c++11 -Wall -Wpedantic") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -O0") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") endif() +# BOOST ISSUE result_of vs C++11 +add_definitions(-DBOOST_RESULT_OF_USE_DECLTYPE) find_package(Boost) if(NOT Boost_FOUND) diff --git a/src/Contraction/test/CMakeLists.txt b/src/Contraction/test/CMakeLists.txt index b52c4862..6dddff1b 100644 --- a/src/Contraction/test/CMakeLists.txt +++ b/src/Contraction/test/CMakeLists.txt @@ -1,6 +1,20 @@ cmake_minimum_required(VERSION 2.6) project(GUDHIskbl) +if(NOT MSVC) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} --coverage") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} --coverage") +endif() + add_executable(TestContraction TestContraction.cpp) +# Unitary tests add_test(TestContraction ${CMAKE_CURRENT_BINARY_DIR}/TestContraction ${CMAKE_SOURCE_DIR}/data/meshes/SO3_50000.off 0.2) + +if (LCOV_PATH) + # Lcov code coverage of unitary test + add_test(src/Contraction/lcov/coverage.log ${CMAKE_SOURCE_DIR}/scripts/check_code_coverage.sh ${CMAKE_SOURCE_DIR}/src/Contraction) +endif() + +cpplint_add_tests("${CMAKE_SOURCE_DIR}/src/Contraction/include/gudhi") diff --git a/src/Persistent_cohomology/example/performance_rips_persistence.cpp b/src/Persistent_cohomology/example/performance_rips_persistence.cpp index 37d41ee1..077c2b07 100644 --- a/src/Persistent_cohomology/example/performance_rips_persistence.cpp +++ b/src/Persistent_cohomology/example/performance_rips_persistence.cpp @@ -31,6 +31,7 @@ #include using namespace Gudhi; +using namespace Gudhi::persistent_cohomology; /* Compute the persistent homology of the complex cpx with coefficients in Z/pZ. */ template< typename FilteredComplex> diff --git a/src/Persistent_cohomology/example/rips_multifield_persistence.cpp b/src/Persistent_cohomology/example/rips_multifield_persistence.cpp index c3203131..2505897e 100644 --- a/src/Persistent_cohomology/example/rips_multifield_persistence.cpp +++ b/src/Persistent_cohomology/example/rips_multifield_persistence.cpp @@ -30,6 +30,7 @@ #include using namespace Gudhi; +using namespace Gudhi::persistent_cohomology; typedef int Vertex_handle; typedef double Filtration_value; diff --git a/src/Persistent_cohomology/example/rips_persistence.cpp b/src/Persistent_cohomology/example/rips_persistence.cpp index d7927223..f7f9527f 100644 --- a/src/Persistent_cohomology/example/rips_persistence.cpp +++ b/src/Persistent_cohomology/example/rips_persistence.cpp @@ -29,6 +29,7 @@ #include using namespace Gudhi; +using namespace Gudhi::persistent_cohomology; typedef int Vertex_handle; typedef double Filtration_value; diff --git a/src/Persistent_cohomology/example/rips_persistence_from_alpha_shape_3.cpp b/src/Persistent_cohomology/example/rips_persistence_from_alpha_shape_3.cpp index ddaafea2..e886aea7 100644 --- a/src/Persistent_cohomology/example/rips_persistence_from_alpha_shape_3.cpp +++ b/src/Persistent_cohomology/example/rips_persistence_from_alpha_shape_3.cpp @@ -29,6 +29,7 @@ #include using namespace Gudhi; +using namespace Gudhi::persistent_cohomology; typedef int Vertex_handle; typedef double Filtration_value; diff --git a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h index a5867013..f638a0fb 100644 --- a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h +++ b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h @@ -40,6 +40,8 @@ namespace Gudhi { +namespace persistent_cohomology { + /** \defgroup persistent_cohomology Persistent Cohomology Package * * Computation of persistent cohomology using the algorithm of @@ -746,6 +748,9 @@ class Persistent_cohomology { }; /** @} */ // end defgroup persistent_cohomology + +} // namespace persistent_cohomology + } // namespace Gudhi #endif // SRC_PERSISTENT_COHOMOLOGY_INCLUDE_GUDHI_PERSISTENT_COHOMOLOGY_H_ diff --git a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Field_Zp.h b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Field_Zp.h index 8b09a800..49883a4a 100644 --- a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Field_Zp.h +++ b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Field_Zp.h @@ -28,6 +28,8 @@ namespace Gudhi { +namespace persistent_cohomology { + /** \brief Structure representing the coefficient field \f$\mathbb{Z}/p\mathbb{Z}\f$ * * \implements CoefficientField @@ -117,6 +119,8 @@ class Field_Zp { const Element add_id_all; }; +} // namespace persistent_cohomology + } // namespace Gudhi #endif // SRC_PERSISTENT_COHOMOLOGY_INCLUDE_GUDHI_PERSISTENT_COHOMOLOGY_FIELD_ZP_H_ diff --git a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Multi_field.h b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Multi_field.h index 5ad4e9cf..306877e7 100644 --- a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Multi_field.h +++ b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Multi_field.h @@ -30,6 +30,8 @@ namespace Gudhi { +namespace persistent_cohomology { + /** \brief Structure representing coefficients in a set of finite fields simultaneously * using the chinese remainder theorem. * @@ -183,6 +185,8 @@ class Multi_field { const Element add_id_all; }; +} // namespace persistent_cohomology + } // namespace Gudhi #endif // SRC_PERSISTENT_COHOMOLOGY_INCLUDE_GUDHI_PERSISTENT_COHOMOLOGY_MULTI_FIELD_H_ diff --git a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Persistent_cohomology_column.h b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Persistent_cohomology_column.h index 632f8e11..fcec819a 100644 --- a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Persistent_cohomology_column.h +++ b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Persistent_cohomology_column.h @@ -31,6 +31,8 @@ namespace Gudhi { +namespace persistent_cohomology { + template class Persistent_cohomology_column; @@ -139,6 +141,8 @@ class Persistent_cohomology_column : public boost::intrusive::set_base_hook< SimplexKey class_key_; }; +} // namespace persistent_cohomology + } // namespace Gudhi #endif // SRC_PERSISTENT_COHOMOLOGY_INCLUDE_GUDHI_PERSISTENT_COHOMOLOGY_PERSISTENT_COHOMOLOGY_COLUMN_H_ diff --git a/src/Persistent_cohomology/test/CMakeLists.txt b/src/Persistent_cohomology/test/CMakeLists.txt index 01432aa1..80689113 100644 --- a/src/Persistent_cohomology/test/CMakeLists.txt +++ b/src/Persistent_cohomology/test/CMakeLists.txt @@ -26,10 +26,4 @@ if (LCOV_PATH) add_test(src/Persistent_cohomology/lcov/coverage.log ${CMAKE_SOURCE_DIR}/scripts/check_code_coverage.sh ${CMAKE_SOURCE_DIR}/src/Persistent_cohomology) endif() -if (PYTHON_PATH) - # Cpplint tests on coding style - add_test(Persistent_cohomology.h.cpplint ${CMAKE_SOURCE_DIR}/scripts/check_google_style.sh ${CMAKE_SOURCE_DIR}/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h) - add_test(Field_Zp.h.cpplint ${CMAKE_SOURCE_DIR}/scripts/check_google_style.sh ${CMAKE_SOURCE_DIR}/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Field_Zp.h) - add_test(Multi_field.h.cpplint ${CMAKE_SOURCE_DIR}/scripts/check_google_style.sh ${CMAKE_SOURCE_DIR}/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Multi_field.h) - add_test(Persistent_cohomology_column.h.cpplint ${CMAKE_SOURCE_DIR}/scripts/check_google_style.sh ${CMAKE_SOURCE_DIR}/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Persistent_cohomology_column.h) -endif() \ No newline at end of file +cpplint_add_tests("${CMAKE_SOURCE_DIR}/src/Persistent_cohomology/include/gudhi") diff --git a/src/Persistent_cohomology/test/persistent_cohomology_unit_test.cpp b/src/Persistent_cohomology/test/persistent_cohomology_unit_test.cpp index e180bea3..1b0cc152 100644 --- a/src/Persistent_cohomology/test/persistent_cohomology_unit_test.cpp +++ b/src/Persistent_cohomology/test/persistent_cohomology_unit_test.cpp @@ -16,6 +16,7 @@ #include "gudhi/Persistent_cohomology.h" using namespace Gudhi; +using namespace Gudhi::persistent_cohomology; typedef Simplex_tree<> typeST; diff --git a/src/Persistent_cohomology/test/persistent_cohomology_unit_test_multi_field.cpp b/src/Persistent_cohomology/test/persistent_cohomology_unit_test_multi_field.cpp index cef29bb0..91cf5784 100644 --- a/src/Persistent_cohomology/test/persistent_cohomology_unit_test_multi_field.cpp +++ b/src/Persistent_cohomology/test/persistent_cohomology_unit_test_multi_field.cpp @@ -17,6 +17,7 @@ #include "gudhi/Persistent_cohomology/Multi_field.h" using namespace Gudhi; +using namespace Gudhi::persistent_cohomology; typedef Simplex_tree<> typeST; diff --git a/src/Simplex_tree/example/CMakeLists.txt b/src/Simplex_tree/example/CMakeLists.txt index cf7585b9..ac145df5 100644 --- a/src/Simplex_tree/example/CMakeLists.txt +++ b/src/Simplex_tree/example/CMakeLists.txt @@ -2,12 +2,12 @@ cmake_minimum_required(VERSION 2.6) project(GUDHISimplexTreeFromFile) add_executable ( simplex_tree_from_file simplex_tree_from_file.cpp ) -target_link_libraries(simplex_tree_from_file ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY}) +target_link_libraries(simplex_tree_from_file ${Boost_SYSTEM_LIBRARY}) add_test(simplex_tree_from_file_2 ${CMAKE_CURRENT_BINARY_DIR}/simplex_tree_from_file ${CMAKE_SOURCE_DIR}/data/points/Klein_bottle_complex.txt 2) add_test(simplex_tree_from_file_3 ${CMAKE_CURRENT_BINARY_DIR}/simplex_tree_from_file ${CMAKE_SOURCE_DIR}/data/points/Klein_bottle_complex.txt 3) add_executable ( simple_simplex_tree simple_simplex_tree.cpp ) -target_link_libraries(simple_simplex_tree ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY}) +target_link_libraries(simple_simplex_tree ${Boost_SYSTEM_LIBRARY}) add_test(simple_simplex_tree ${CMAKE_CURRENT_BINARY_DIR}/simple_simplex_tree) # An example with Simplex-tree using CGAL alpha_shapes_3 @@ -17,6 +17,6 @@ if(GMPXX_FOUND AND GMP_FOUND AND CGAL_FOUND) message("GMP_LIBRARIES = ${GMP_LIBRARIES}") add_executable ( simplex_tree_from_alpha_shapes_3 simplex_tree_from_alpha_shapes_3.cpp ) - target_link_libraries(simplex_tree_from_alpha_shapes_3 ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} ${GMPXX_LIBRARIES} ${GMP_LIBRARIES} ${CGAL_LIBRARY}) + target_link_libraries(simplex_tree_from_alpha_shapes_3 ${Boost_SYSTEM_LIBRARY} ${GMPXX_LIBRARIES} ${GMP_LIBRARIES} ${CGAL_LIBRARY}) add_test(simplex_tree_from_alpha_shapes_3 ${CMAKE_CURRENT_BINARY_DIR}/simplex_tree_from_alpha_shapes_3 ${CMAKE_SOURCE_DIR}/data/points/bunny_5000) endif() diff --git a/src/Simplex_tree/include/gudhi/Simplex_tree/Simplex_tree_siblings.h b/src/Simplex_tree/include/gudhi/Simplex_tree/Simplex_tree_siblings.h index 9ad2b751..977fafa1 100644 --- a/src/Simplex_tree/include/gudhi/Simplex_tree/Simplex_tree_siblings.h +++ b/src/Simplex_tree/include/gudhi/Simplex_tree/Simplex_tree_siblings.h @@ -20,12 +20,15 @@ * along with this program. If not, see . */ -#ifndef GUDHI_SIMPLEX_TREE_SIBLINGS -#define GUDHI_SIMPLEX_TREE_SIBLINGS +#ifndef SRC_SIMPLEX_TREE_INCLUDE_GUDHI_SIMPLEX_TREE_SIMPLEX_TREE_SIBLINGS_H_ +#define SRC_SIMPLEX_TREE_INCLUDE_GUDHI_SIMPLEX_TREE_SIMPLEX_TREE_SIBLINGS_H_ #include "boost/container/flat_map.hpp" #include "Simplex_tree_node_explicit_storage.h" +#include +#include + namespace Gudhi { /* \addtogroup simplex_tree @@ -69,7 +72,7 @@ class Simplex_tree_siblings { * * 'members' must be sorted and unique.*/ Simplex_tree_siblings(Simplex_tree_siblings * oncles, Vertex_handle parent, - std::vector > & members) + const std::vector > & members) : oncles_(oncles), parent_(parent), members_(boost::container::ordered_unique_range, members.begin(), @@ -122,10 +125,9 @@ class Simplex_tree_siblings { Simplex_tree_siblings * oncles_; Vertex_handle parent_; Dictionary members_; - }; -/* @} */ //end addtogroup simplex_tree -}// namespace Gudhi +/* @} */ // end addtogroup simplex_tree +} // namespace Gudhi -#endif // GUDHI_SIMPLEX_TREE_SIBLINGS +#endif // SRC_SIMPLEX_TREE_INCLUDE_GUDHI_SIMPLEX_TREE_SIMPLEX_TREE_SIBLINGS_H_ diff --git a/src/Simplex_tree/test/CMakeLists.txt b/src/Simplex_tree/test/CMakeLists.txt index 80594870..02ef9d8b 100644 --- a/src/Simplex_tree/test/CMakeLists.txt +++ b/src/Simplex_tree/test/CMakeLists.txt @@ -18,11 +18,4 @@ if (LCOV_PATH) add_test(src/Simplex_tree/lcov/coverage.log ${CMAKE_SOURCE_DIR}/scripts/check_code_coverage.sh ${CMAKE_SOURCE_DIR}/src/Simplex_tree) endif() -if (PYTHON_PATH) - # Cpplint tests on coding style - add_test(Simplex_tree.h.cpplint ${CMAKE_SOURCE_DIR}/scripts/check_google_style.sh ${CMAKE_SOURCE_DIR}/src/Simplex_tree/include/gudhi/Simplex_tree.h) - add_test(indexing_tag.h.cpplint ${CMAKE_SOURCE_DIR}/scripts/check_google_style.sh ${CMAKE_SOURCE_DIR}/src/Simplex_tree/include/gudhi/Simplex_tree/indexing_tag.h) - add_test(Simplex_tree_iterators.h.cpplint ${CMAKE_SOURCE_DIR}/scripts/check_google_style.sh ${CMAKE_SOURCE_DIR}/src/Simplex_tree/include/gudhi/Simplex_tree/Simplex_tree_iterators.h) - add_test(Simplex_tree_node_explicit_storage.h.cpplint ${CMAKE_SOURCE_DIR}/scripts/check_google_style.sh ${CMAKE_SOURCE_DIR}/src/Simplex_tree/include/gudhi/Simplex_tree/Simplex_tree_node_explicit_storage.h) - add_test(Simplex_tree_siblings.h.cpplint ${CMAKE_SOURCE_DIR}/scripts/check_google_style.sh ${CMAKE_SOURCE_DIR}/src/Simplex_tree/include/gudhi/Simplex_tree/Simplex_tree_siblings.h) -endif() \ No newline at end of file +cpplint_add_tests("${CMAKE_SOURCE_DIR}/src/Simplex_tree/include/gudhi") diff --git a/src/Skeleton_blocker/test/CMakeLists.txt b/src/Skeleton_blocker/test/CMakeLists.txt index 0047499d..c341dcee 100644 --- a/src/Skeleton_blocker/test/CMakeLists.txt +++ b/src/Skeleton_blocker/test/CMakeLists.txt @@ -1,8 +1,21 @@ cmake_minimum_required(VERSION 2.6) project(GUDHIskbl) +if(NOT MSVC) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} --coverage") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} --coverage") +endif() + add_executable(TestSkeletonBlockerComplex TestSkeletonBlockerComplex.cpp) add_executable(TestSimplifiable TestSimplifiable.cpp) add_test(TestSkeletonBlockerComplex ${CMAKE_CURRENT_BINARY_DIR}/TestSkeletonBlockerComplex) add_test(TestSimplifiable ${CMAKE_CURRENT_BINARY_DIR}/TestSimplifiable) + +if (LCOV_PATH) + # Lcov code coverage of unitary test + add_test(src/Skeleton_blocker/lcov/coverage.log ${CMAKE_SOURCE_DIR}/scripts/check_code_coverage.sh ${CMAKE_SOURCE_DIR}/src/Skeleton_blocker) +endif() + +cpplint_add_tests("${CMAKE_SOURCE_DIR}/src/Skeleton_blocker/include/gudhi") -- cgit v1.2.3