From: Matthias Maier Date: Sat, 10 Dec 2022 06:12:41 +0000 (-0600) Subject: Tests: convert quicktests to regular tests X-Git-Tag: v9.5.0-rc1~733^2~6 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5450175f14abc0feef5a9aae2271c3c769811550;p=dealii.git Tests: convert quicktests to regular tests --- diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index d759f69dd8..cd22872439 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -53,22 +53,6 @@ endif() if(DEFINED DEAL_II_HAVE_TESTS_DIRECTORY) - # - # We have to repeat the policy statement here because the new - # CMAKE_MINIMUM_REQUIRED call resets our previous policy set in the main - # CMakeLists.txt file. - # - if("${CMAKE_VERSION}" VERSION_LESS "3.11" AND POLICY CMP0037) - # allow to override "test" target for quick tests - cmake_policy(SET CMP0037 OLD) - endif() - - # - # If this CMakeLists.txt file is called from within the deal.II build - # system, set up quick tests as well: - # - add_subdirectory(quick_tests) - message(STATUS "Setting up testsuite") # @@ -95,9 +79,7 @@ else() set(_options "-DDEAL_II_DIR=${DEAL_II_PATH}") endif() -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CTestTestfile.cmake - "subdirs(quick_tests)\n" - ) +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CTestTestfile.cmake "") # # Always undefine the following variables in the setup_tests target: @@ -115,15 +97,14 @@ endforeach() # # Find all testsuite subprojects, i.e., every directory that contains a -# CMakeLists.txt file (with the exception of "quick_tests"). +# CMakeLists.txt file. # set(_categories) file(GLOB _dirs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/* ) foreach(_dir ${_dirs}) - if( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_dir}/CMakeLists.txt AND - NOT ${_dir} MATCHES quick_tests) + if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_dir}/CMakeLists.txt) list(APPEND _categories ${_dir}) endif() endforeach() diff --git a/tests/quick_tests/CMakeLists.txt b/tests/quick_tests/CMakeLists.txt index 880173408f..b18daa7f53 100644 --- a/tests/quick_tests/CMakeLists.txt +++ b/tests/quick_tests/CMakeLists.txt @@ -1,211 +1,4 @@ -## --------------------------------------------------------------------- -## -## Copyright (C) 2013 - 2021 by the deal.II authors -## -## This file is part of the deal.II library. -## -## The deal.II library is free software; you can use it, redistribute -## it, and/or modify it under the terms of the GNU Lesser General -## Public License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## The full text of the license can be found in the file LICENSE.md at -## the top level directory of deal.II. -## -## --------------------------------------------------------------------- - -# -# A minimalistic set of tests: -# -enable_testing() - -include_directories( - ${CMAKE_BINARY_DIR}/include/ - ${CMAKE_SOURCE_DIR}/include/ - ${DEAL_II_BUNDLED_INCLUDE_DIRS} - ${DEAL_II_INCLUDE_DIRS} - ) - -# Use the first available build type (this prefers debug mode if available): -list(GET DEAL_II_BUILD_TYPES 0 _mybuild) -message(STATUS "Setting up quick_tests in ${_mybuild} mode") - -set(ALL_TESTS) # clean variable - -# define a macro to set up a quick test: -macro(make_quicktest test_basename build_name mpi_run) - string(TOLOWER ${build_name} _build_lowercase) - set(_test "quick_tests/${test_basename}.${_build_lowercase}") - set(_target "quick_tests_${test_basename}_${_build_lowercase}") - - list(APPEND ALL_TESTS "${_test}") - add_executable(${_target} EXCLUDE_FROM_ALL ${test_basename}.cc) - insource_setup_target(${_target} ${build_name}) - - if("${mpi_run}" STREQUAL "") - set(_command ${_target}) - else() - if(CMAKE_SYSTEM_NAME MATCHES "Windows") - set(_command ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${mpi_run} ${MPIEXEC_PREFLAGS} ${_target}) - else() - set(_command ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${mpi_run} ${MPIEXEC_PREFLAGS} ./${_target}) - endif() - endif() - add_custom_target(${_target}_run - DEPENDS ${_target} - COMMAND - ${_command} > ${_target}-OK 2>&1 - ||(echo "${_target}: RUN failed. Output:" - && cat ${_target}-OK - && rm ${_target}-OK - && exit 1) - COMMAND echo "${_test}: PASSED." - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - ) - - # this is a hack to make sure the -OK file is deleted even if compilation - # fails. - add_custom_target(reset_${_target} - COMMAND ${CMAKE_COMMAND} -E remove -f ${_target}-OK - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - ) - add_dependencies(${_target} reset_${_target}) - - add_test(NAME ${_test} - COMMAND ${CMAKE_COMMAND} -DTRGT=${_target}_run -DTEST=${_test} - -DBINARY_DIR=${CMAKE_BINARY_DIR} - -P ${CMAKE_SOURCE_DIR}/cmake/scripts/run_test.cmake - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - ) - set_tests_properties(${_test} PROPERTIES - LABEL "sanity checks" - ENVIRONMENT "OMPI_MCA_rmaps_base_oversubscribe=1") - # ^^^ Allow oversubscription for MPI (needed for Openmpi@3.0) -endmacro() - - -# Simple assembly/solver test. This makes sure we can compile and link correctly -# in debug and release. -foreach(_build ${DEAL_II_BUILD_TYPES}) - make_quicktest("step" ${_build} "") -endforeach() - -# Test whether thread affinity is well behaved -make_quicktest("affinity" ${_mybuild} "") - -# Test if MPI is configured correctly -if (DEAL_II_WITH_MPI) - make_quicktest("mpi" ${_mybuild} 2) -endif() - -# Test if TBB works correctly -if (DEAL_II_WITH_TBB) - make_quicktest("tbb" ${_mybuild} "") -endif() - -# test taskflow -if (DEAL_II_WITH_TASKFLOW) - make_quicktest("taskflow" ${_mybuild} "") -endif() - -# Test p4est. This test exposes a bug in OpenMPI 1.3 and 1.4 -# Update to OpenMPI 1.5 or newer. -if (DEAL_II_WITH_P4EST) - make_quicktest("p4est" ${_mybuild} 10) -endif() - -# Test petsc -if (DEAL_II_WITH_PETSC) - make_quicktest("step-petsc" ${_mybuild} "") -endif() - -# Test slepc -if (DEAL_II_WITH_PETSC AND DEAL_II_WITH_SLEPC) - make_quicktest("step-slepc" ${_mybuild} "") -endif() - -# Test trilinos -if (DEAL_II_WITH_TRILINOS) - make_quicktest("step-trilinos" ${_mybuild} "") -endif() - -# Test metis -if (DEAL_II_WITH_METIS AND DEAL_II_WITH_MPI) - make_quicktest("step-metis" ${_mybuild} 2) -endif() - -# Test LAPACK -if (DEAL_II_WITH_LAPACK) - make_quicktest("lapack" ${_mybuild} "") -endif() - -# Test Umfpack -if (DEAL_II_WITH_UMFPACK) - make_quicktest("umfpack" ${_mybuild} "") -endif() - -# Test GSL -if (DEAL_II_WITH_GSL) - make_quicktest("gsl" ${_mybuild} "") -endif() - -# Test HDF5 -if (DEAL_II_WITH_HDF5) - make_quicktest("hdf5" ${_mybuild} "") -endif() - -# Test Arpack -if (DEAL_II_WITH_ARPACK AND DEAL_II_WITH_UMFPACK) - make_quicktest("arpack" ${_mybuild} "") -endif() - -# Test Adol-C -if (DEAL_II_WITH_ADOLC) - make_quicktest("adolc" ${_mybuild} "") -endif() - -# Test SUNDIALS -if (DEAL_II_WITH_SUNDIALS) - make_quicktest("sundials-ida" ${_mybuild} "") -endif() - -# Test Assimp -if (DEAL_II_WITH_ASSIMP) - make_quicktest("assimp" ${_mybuild} "") -endif() - -# Test CUDA -if (DEAL_II_WITH_CUDA) - make_quicktest("cuda" ${_mybuild} "") -endif() - -# Test ScaLAPACK -if (DEAL_II_WITH_SCALAPACK) - make_quicktest("scalapack" ${_mybuild} 5) -endif() - -# Test Zlib and Boost -if (DEAL_II_WITH_ZLIB) - make_quicktest("boost_zlib" ${_mybuild} "") -endif() - -# Test GMSH -if (DEAL_II_WITH_GMSH) - make_quicktest("gmsh" ${_mybuild} "") -endif() - -# Test SymEngine -if (DEAL_II_WITH_SYMENGINE) - make_quicktest("symengine" ${_mybuild} "") -endif() - -# Test Kokkos -make_quicktest("kokkos" ${_mybuild} "") - -# A custom test target: -add_custom_target(test - COMMAND ${CMAKE_COMMAND} -D ALL_TESTS="${ALL_TESTS}" -DCMAKE_BUILD_TYPE=${_mybuild} -P ${CMAKE_CURRENT_SOURCE_DIR}/run.cmake - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - COMMENT "Running quicktests..." - ) - -message(STATUS "Setting up quick_tests in ${_mybuild} mode - Done") +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +deal_ii_pickup_tests() diff --git a/tests/quick_tests/adolc.with_adolc=true.run_only b/tests/quick_tests/adolc.with_adolc=true.run_only new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/quick_tests/affinity.run_only b/tests/quick_tests/affinity.run_only new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/quick_tests/arpack.with_arpck=true.run_only b/tests/quick_tests/arpack.with_arpck=true.run_only new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/quick_tests/assimp.with_assimp=true.run_only b/tests/quick_tests/assimp.with_assimp=true.run_only new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/quick_tests/boost_zlib.with_zlib=true.run_only b/tests/quick_tests/boost_zlib.with_zlib=true.run_only new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/quick_tests/cuda.with_cuda=true.run_only b/tests/quick_tests/cuda.with_cuda=true.run_only new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/quick_tests/gmsh.with_gmsh=true.run_only b/tests/quick_tests/gmsh.with_gmsh=true.run_only new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/quick_tests/gsl.with_gsl=true.run_only b/tests/quick_tests/gsl.with_gsl=true.run_only new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/quick_tests/hdf5.with_hdf5=true.run_only b/tests/quick_tests/hdf5.with_hdf5=true.run_only new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/quick_tests/kokkos.run_only b/tests/quick_tests/kokkos.run_only new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/quick_tests/lapack.with_lapack=true.run_only b/tests/quick_tests/lapack.with_lapack=true.run_only new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/quick_tests/mpi.with_mpi=true.mpirun=2.run_only b/tests/quick_tests/mpi.with_mpi=true.mpirun=2.run_only new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/quick_tests/p4est.cc b/tests/quick_tests/p4est.cc index ab406a980a..2ab4b07cb2 100644 --- a/tests/quick_tests/p4est.cc +++ b/tests/quick_tests/p4est.cc @@ -17,6 +17,9 @@ // Test DoFTools::count_dofs_per_fe_component +// Test p4est. This test exposes a bug in OpenMPI 1.3 and 1.4 Update to +// OpenMPI 1.5 or newer. + #include #include diff --git a/tests/quick_tests/p4est.with_p4est=true.with_mpi=true.mpirun=10.run_only b/tests/quick_tests/p4est.with_p4est=true.with_mpi=true.mpirun=10.run_only new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/quick_tests/scalapack.with_scalapack=true.with_mpi=true.run_only b/tests/quick_tests/scalapack.with_scalapack=true.with_mpi=true.run_only new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/quick_tests/step-metis.with_metis=true.with_mpi=true.mpirun=2.run_only b/tests/quick_tests/step-metis.with_metis=true.with_mpi=true.mpirun=2.run_only new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/quick_tests/step-petsc.with_petsc=true.run_only b/tests/quick_tests/step-petsc.with_petsc=true.run_only new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/quick_tests/step-slepc.with_petsc=true.with_slepc=true.run_only b/tests/quick_tests/step-slepc.with_petsc=true.with_slepc=true.run_only new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/quick_tests/step-trilinos.with_trilinos=true.run_only b/tests/quick_tests/step-trilinos.with_trilinos=true.run_only new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/quick_tests/step.run_only b/tests/quick_tests/step.run_only new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/quick_tests/sundials-ida.with_sundials=true.run_only b/tests/quick_tests/sundials-ida.with_sundials=true.run_only new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/quick_tests/symengine.with_symengine=true.run_only b/tests/quick_tests/symengine.with_symengine=true.run_only new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/quick_tests/taskflow.with_taskflow=true.run_only b/tests/quick_tests/taskflow.with_taskflow=true.run_only new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/quick_tests/tbb.with_tbb=true.run_only b/tests/quick_tests/tbb.with_tbb=true.run_only new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/quick_tests/umfpack.with_umfpack=true.run_only b/tests/quick_tests/umfpack.with_umfpack=true.run_only new file mode 100644 index 0000000000..e69de29bb2