diff options
author | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2015-02-06 10:53:07 +0000 |
---|---|---|
committer | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2015-02-06 10:53:07 +0000 |
commit | 9c6ad56de2646de1f0c667370ce99f574cb75705 (patch) | |
tree | 479f21386e0ae73539cca1a0795d064dbd7502bc /src | |
parent | d6c70c37a581a750c55bca0cc040ae749cfd2276 (diff) |
Fix of unitary tests under windows
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@460 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: 93a416618a19024dca350c07509a838314fb32ea
Diffstat (limited to 'src')
3 files changed, 12 insertions, 4 deletions
diff --git a/src/Persistent_cohomology/test/CMakeLists.txt b/src/Persistent_cohomology/test/CMakeLists.txt index 80689113..5c811bfa 100644 --- a/src/Persistent_cohomology/test/CMakeLists.txt +++ b/src/Persistent_cohomology/test/CMakeLists.txt @@ -11,14 +11,14 @@ add_executable ( persistent_cohomology_unit_test persistent_cohomology_unit_test target_link_libraries(persistent_cohomology_unit_test ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) # Unitary tests -add_test(persistent_cohomology_unit_test ${CMAKE_CURRENT_BINARY_DIR}/persistent_cohomology_unit_test) +add_test(persistent_cohomology_unit_test ${CMAKE_CURRENT_BINARY_DIR}/persistent_cohomology_unit_test ${CMAKE_SOURCE_DIR}/src/Persistent_cohomology/test/simplex_tree_file_for_unit_test.txt) if(GMPXX_FOUND AND GMP_FOUND) add_executable ( persistent_cohomology_unit_test_multi_field persistent_cohomology_unit_test_multi_field.cpp ) target_link_libraries(persistent_cohomology_unit_test_multi_field ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${GMPXX_LIBRARIES} ${GMP_LIBRARIES}) # Unitary tests - #add_test(persistent_cohomology_unit_test_multi_field ${CMAKE_CURRENT_BINARY_DIR}/persistent_cohomology_unit_test_multi_field) + add_test(persistent_cohomology_unit_test_multi_field ${CMAKE_CURRENT_BINARY_DIR}/persistent_cohomology_unit_test_multi_field ${CMAKE_SOURCE_DIR}/src/Persistent_cohomology/test/simplex_tree_file_for_unit_test_multi_field.txt) endif() if (LCOV_PATH) diff --git a/src/Persistent_cohomology/test/persistent_cohomology_unit_test.cpp b/src/Persistent_cohomology/test/persistent_cohomology_unit_test.cpp index 0c1b52c6..2e059b09 100644 --- a/src/Persistent_cohomology/test/persistent_cohomology_unit_test.cpp +++ b/src/Persistent_cohomology/test/persistent_cohomology_unit_test.cpp @@ -17,11 +17,15 @@ using namespace Gudhi; using namespace Gudhi::persistent_cohomology; +using namespace boost::unit_test; typedef Simplex_tree<> typeST; std::string test_rips_persistence(int coefficient, int min_persistence) { - const std::string inputFile("simplex_tree_file_for_unit_test.txt"); + // Check file name is given as parameter from CMakeLists.txt + BOOST_CHECK(framework::master_test_suite().argc == 2); + const std::string inputFile(framework::master_test_suite().argv[1]); + std::ifstream simplex_tree_stream; simplex_tree_stream.open(inputFile.c_str()); typeST st; 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 91cf5784..196461e2 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 @@ -18,11 +18,15 @@ using namespace Gudhi; using namespace Gudhi::persistent_cohomology; +using namespace boost::unit_test; typedef Simplex_tree<> typeST; std::string test_rips_persistence(int min_coefficient, int max_coefficient, int min_persistence) { - const std::string inputFile("simplex_tree_file_for_multi_field_unit_test.txt"); + // Check file name is given as parameter from CMakeLists.txt + BOOST_CHECK(framework::master_test_suite().argc == 2); + const std::string inputFile(framework::master_test_suite().argv[1]); + std::ifstream simplex_tree_stream; simplex_tree_stream.open(inputFile.c_str()); typeST st; |