diff --git a/CMakeLists.txt b/CMakeLists.txt index c765b2d3675884fc164b87d04d7484a4b95abf06..4a9b06b7e9f6a39355ba0fc8b3b8305f63c2da8c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,8 +30,8 @@ include(MyTools) # User defined options option(VERBOSE_MODE "Print cmake-hysop state summary. Default = on" ON) -option(DOUBLEPREC "switch between single and double precision for real numbers. Default = on, ie double precision." ON) -option(USE_MPI "compile and link HySoP with mpi when this mode is enable. Default = on. WARNING: off mode is bugged." ON) +option(DOUBLEPREC "Set default HySoP floating point precision. Default = on, ie double precision else single precision will be used." ON) +option(USE_MPI "Compile and link HySoP with mpi when this mode is enable. Default = on. WARNING: off mode is bugged." ON) option(WITH_TESTS "Enable testing. Default = OFF" ON) option(BUILD_SHARED_LIBS "Enable dynamic library build, default = ON." ON) option(USE_CXX "Expand hysop with some new functions from a generated c++ to python interface, wrapped into hysop.cpp2hysop module. Default = ON." ON) @@ -581,9 +581,9 @@ add_custom_target(pyclean COMMAND rm -f ${PYCFILES} # ============= Tests ============= if(WITH_TESTS) if(NOT ENABLE_LONG_TESTS) - set(TEST_TIMEOUT 15 CACHE STRING "Default value for test runtime limit (in seconds)") + set(TEST_TIMEOUT 360 CACHE STRING "Default value for test runtime limit (in seconds)") else() - set(TEST_TIMEOUT 500 CACHE STRING "Default value for test runtime limit (in seconds)") + set(TEST_TIMEOUT 3600 CACHE STRING "Default value for test runtime limit (in seconds)") endif() include(CTest) # Number of mpi processes used to run tests. diff --git a/cmake/hysop_tests.cmake b/cmake/hysop_tests.cmake index e529368f99f8614e78187d35c096c3b8ad008cca..8161e359074bdd030081cbc10bbe5f53a0032697 100755 --- a/cmake/hysop_tests.cmake +++ b/cmake/hysop_tests.cmake @@ -13,11 +13,17 @@ enable_testing() find_python_module(pytest REQUIRED) +# === Tests options === +set(pytest_opt "-v" CACHE INTERNAL "extra options for py.test") + +# Force create data directory for tests event if no tests needs it +# because this will we the working directory for all tests. +file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/dataForTests) + # Declaration of python test # Usage: -# add_python_test(name file) -# with 'name' is the name of the test and file the source -# file for the test. +# Add_python_test(name file) with 'name' is the name of the test +# and file the source file for the test. macro(add_python_test test_name test_file) add_test(${test_name} py.test "${pytest_opt}" ${test_file}) set_tests_properties(${test_name} PROPERTIES FAIL_REGULAR_EXPRESSION "FAILURE;Exception;[^x]failed;ERROR;Assertion") @@ -45,16 +51,8 @@ endmacro() # --> set test dir set(testDir ${HYSOP_BUILD_PYTHONPATH}) -# === Tests options === -if(FULL_TEST) - set(pytest_opt "-s -v -pep8" CACHE INTERNAL "extra options for py.test") -else() - set(pytest_opt "-v" CACHE INTERNAL "extra options for py.test") -endif() - - # === Set the list of all directories which may contain tests === -set(py_src_dirs operator) +set(py_src_dirs core/arrays fields operator) # === Create the files list from all directories in py_src_dirs === @@ -63,7 +61,7 @@ set(py_test_files) foreach(testdir ${py_src_dirs}) file(GLOB testfiles RELATIVE ${CMAKE_SOURCE_DIR} hysop/${testdir}/tests/test_*.py) set(py_test_files ${py_test_files} ${testfiles}) - # copy data files + # copy data files required by the tests file(GLOB reffiles hysop/${testdir}/tests/ref_files/*) file(COPY ${reffiles} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/dataForTests) endforeach() @@ -83,7 +81,6 @@ foreach(testdir ${py_src_dirs}) endforeach() endforeach() - # === Create tests from py_test_files === foreach(testfile ${py_test_files}) set(execname ${CMAKE_SOURCE_DIR}/${testfile})