Skip to content

Commit

Permalink
Merge pull request #110 from arcaneframework/bug/mab/petsc-tests
Browse files Browse the repository at this point in the history
run tests only if PETSc is present #109
  • Loading branch information
mohd-afeef-badri authored Jan 30, 2024
2 parents 8b1d498 + 43813ff commit 4661c9d
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 31 deletions.
4 changes: 3 additions & 1 deletion aerodynamics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ target_link_libraries(aerodynamics PUBLIC FemUtils)

enable_testing()

add_test(NAME [aerodynamics]Joukowski COMMAND aerodynamics Test.Joukowski.arc)
if(FEMUTILS_HAS_SOLVER_BACKEND_PETSC)
add_test(NAME [aerodynamics]Joukowski COMMAND aerodynamics Test.Joukowski.arc)
endif()

# If parallel part is available, add some tests
if(FEMUTILS_HAS_PARALLEL_SOLVER AND MPIEXEC_EXECUTABLE)
Expand Down
1 change: 1 addition & 0 deletions bilaplacian/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ configure_file(${MSH_DIR}/bilap.msh ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
target_link_libraries(Bilaplacian PUBLIC FemUtils)

enable_testing()

add_test(NAME [bilaplacian]direct_solver COMMAND Bilaplacian Test.Bilaplacian.direct.arc)
add_test(NAME [bilaplacian]internal_PCG_solver COMMAND Bilaplacian Test.Bilaplacian.internal_pcg.arc)
13 changes: 8 additions & 5 deletions elasticity/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@ configure_file(${MSH_DIR}/bar.msh ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
target_link_libraries(Elasticity PUBLIC FemUtils)

enable_testing()
add_test(NAME [elasticity] COMMAND Elasticity Test.Elasticity.arc)
add_test(NAME [elasticity]Dirichlet_traction COMMAND Elasticity Test.Elasticity.traction.arc)
add_test(NAME [elasticity]Dirichlet_pointBC COMMAND Elasticity Test.Elasticity.PointDirichlet.arc)
add_test(NAME [elasticity]Dirichlet_via_RowElimination COMMAND Elasticity Test.Elasticity.DirichletViaRowElimination.arc)
add_test(NAME [elasticity]Dirichlet_via_RowColElimination COMMAND Elasticity Test.Elasticity.DirichletViaRowColumnElimination.arc)

if(FEMUTILS_HAS_SOLVER_BACKEND_PETSC)
add_test(NAME [elasticity] COMMAND Elasticity Test.Elasticity.arc)
add_test(NAME [elasticity]Dirichlet_traction COMMAND Elasticity Test.Elasticity.traction.arc)
add_test(NAME [elasticity]Dirichlet_pointBC COMMAND Elasticity Test.Elasticity.PointDirichlet.arc)
add_test(NAME [elasticity]Dirichlet_via_RowElimination COMMAND Elasticity Test.Elasticity.DirichletViaRowElimination.arc)
add_test(NAME [elasticity]Dirichlet_via_RowColElimination COMMAND Elasticity Test.Elasticity.DirichletViaRowColumnElimination.arc)
endif()

# If parallel part is available, add some tests
if(FEMUTILS_HAS_PARALLEL_SOLVER AND MPIEXEC_EXECUTABLE)
Expand Down
13 changes: 8 additions & 5 deletions elastodynamics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ configure_file(${MSH_DIR}/semi-circle.msh ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
target_link_libraries(Elastodynamics PUBLIC FemUtils)

enable_testing()
add_test(NAME [elastodynamics] COMMAND Elastodynamics Test.Elastodynamics.arc)
add_test(NAME [elastodynamics]transient_traction COMMAND Elastodynamics Test.Elastodynamics.transient-traction.arc)
add_test(NAME [elastodynamics]Dirichlet_pointBc COMMAND Elastodynamics Test.Elastodynamics.pointBC.arc)
add_test(NAME [elastodynamics]constant_traction_and_damping COMMAND Elastodynamics Test.Elastodynamics.damping.arc)
add_test(NAME [elastodynamics]time-discretization_Galpha COMMAND Elastodynamics Test.Elastodynamics.Galpha.arc)

if(FEMUTILS_HAS_SOLVER_BACKEND_PETSC)
add_test(NAME [elastodynamics] COMMAND Elastodynamics Test.Elastodynamics.arc)
add_test(NAME [elastodynamics]transient_traction COMMAND Elastodynamics Test.Elastodynamics.transient-traction.arc)
add_test(NAME [elastodynamics]Dirichlet_pointBc COMMAND Elastodynamics Test.Elastodynamics.pointBC.arc)
add_test(NAME [elastodynamics]constant_traction_and_damping COMMAND Elastodynamics Test.Elastodynamics.damping.arc)
add_test(NAME [elastodynamics]time-discretization_Galpha COMMAND Elastodynamics Test.Elastodynamics.Galpha.arc)
endif()
6 changes: 4 additions & 2 deletions electrostatics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ file(COPY "tests/" DESTINATION ${CMAKE_CURRENT_BINARY_DIR})

enable_testing()

add_test(NAME [electrostatics] COMMAND Electrostatics Test.Electrostatics.arc)
add_test(NAME [electrostatics]rod-circle COMMAND Electrostatics Test.Electrostatics.rod-circle.arc)
if(FEMUTILS_HAS_SOLVER_BACKEND_PETSC)
add_test(NAME [electrostatics] COMMAND Electrostatics Test.Electrostatics.arc)
add_test(NAME [electrostatics]rod-circle COMMAND Electrostatics Test.Electrostatics.rod-circle.arc)
endif()

# If parallel part is available, add some tests
if(FEMUTILS_HAS_PARALLEL_SOLVER AND MPIEXEC_EXECUTABLE)
Expand Down
13 changes: 5 additions & 8 deletions fourier/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,11 @@ endif()

enable_testing()

add_test(NAME [Fourier]conduction COMMAND Fourier Test.conduction.arc)
add_test(NAME [Fourier]conduction_heterogeneous COMMAND Fourier Test.conduction.heterogeneous.arc)
add_test(NAME [Fourier]conduction_quad COMMAND Fourier Test.conduction.quad4.arc)

#if(FEMTEST_HAS_GMSH_TEST)
# add_test(NAME [Fourier]conduction_10k COMMAND ./Fourier Test.conduction.10k.arc)
# add_test(NAME [Fourier]conduction_heterogeneous_10k COMMAND ./Fourier Test.conduction.heterogeneous.10k.arc)
#endif()
if(FEMUTILS_HAS_SOLVER_BACKEND_PETSC)
add_test(NAME [Fourier]conduction COMMAND Fourier Test.conduction.arc)
add_test(NAME [Fourier]conduction_heterogeneous COMMAND Fourier Test.conduction.heterogeneous.arc)
add_test(NAME [Fourier]conduction_quad COMMAND Fourier Test.conduction.quad4.arc)
endif()


# If parallel part is available, add some tests
Expand Down
12 changes: 8 additions & 4 deletions heat/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,14 @@ endif()

enable_testing()

add_test(NAME [heat]conduction COMMAND heat Test.conduction.arc)
add_test(NAME [heat]conduction_RowElimination_Dirichlet COMMAND heat Test.conduction.DirichletViaRowElimination.arc)
add_test(NAME [heat]conduction_RowColElimination_Dirichlet COMMAND heat Test.conduction.DirichletViaRowColumnElimination.arc)
add_test(NAME [heat]conduction_convection COMMAND heat Test.conduction.convection.arc)

if(FEMUTILS_HAS_SOLVER_BACKEND_PETSC)
add_test(NAME [heat]conduction COMMAND heat Test.conduction.arc)
add_test(NAME [heat]conduction_RowElimination_Dirichlet COMMAND heat Test.conduction.DirichletViaRowElimination.arc)
add_test(NAME [heat]conduction_RowColElimination_Dirichlet COMMAND heat Test.conduction.DirichletViaRowColumnElimination.arc)
add_test(NAME [heat]conduction_convection COMMAND heat Test.conduction.convection.arc)
endif()


# If parallel part is available, add some tests
if(FEMUTILS_HAS_PARALLEL_SOLVER AND MPIEXEC_EXECUTABLE)
Expand Down
5 changes: 4 additions & 1 deletion laplace/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ endif()

enable_testing()

add_test(NAME [laplace]laplace COMMAND Laplace Test.laplace.arc)
if(FEMUTILS_HAS_SOLVER_BACKEND_PETSC)
add_test(NAME [laplace]laplace COMMAND Laplace Test.laplace.arc)
endif()

add_test(NAME [laplace]laplace_pointDirichlet COMMAND Laplace Test.laplace.PointDirichlet.arc)

# If parallel part is available, add some tests
Expand Down
9 changes: 7 additions & 2 deletions poisson/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,14 @@ file(COPY "tests/" DESTINATION ${CMAKE_CURRENT_BINARY_DIR})

enable_testing()

add_test(NAME [poisson]poisson COMMAND Poisson Test.poisson.arc)

add_test(NAME [poisson]poisson_direct COMMAND Poisson Test.poisson.direct.arc)
add_test(NAME [poisson]poisson_neumann COMMAND Poisson Test.poisson.neumann.arc)

if(FEMUTILS_HAS_SOLVER_BACKEND_TRILINOS)
add_test(NAME [poisson]poisson_trilinos COMMAND Poisson Test.poisson.trilinos.arc)
endif()


if(FEMUTILS_HAS_SOLVER_BACKEND_HYPRE)
add_test(NAME [poisson]poisson_hypre COMMAND Poisson Test.poisson.hypre.arc)
add_test(NAME [poisson]poisson_hypre_direct COMMAND Poisson Test.poisson.hypre_direct.arc)
Expand All @@ -92,8 +93,12 @@ if(FEMUTILS_HAS_SOLVER_BACKEND_HYPRE)
add_test(NAME [poisson]poisson_hypre_direct_4pe COMMAND ${MPIEXEC_EXECUTABLE} -n 4 ./Poisson Test.poisson.hypre_direct.arc)
endif()
endif()


if(FEMUTILS_HAS_SOLVER_BACKEND_PETSC)
add_test(NAME [poisson]poisson COMMAND Poisson Test.poisson.arc)
add_test(NAME [poisson]poisson_petsc COMMAND Poisson Test.poisson.petsc.arc)
add_test(NAME [poisson]poisson_neumann COMMAND Poisson Test.poisson.neumann.arc)
endif()


Expand Down
9 changes: 6 additions & 3 deletions soildynamics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ target_link_libraries(Soildynamics PUBLIC FemUtils)
file(COPY "data/" DESTINATION ${CMAKE_CURRENT_BINARY_DIR})

enable_testing()
add_test(NAME [soildynamics]soildynamics COMMAND Soildynamics Test.Soildynamics.arc)
add_test(NAME [soildynamics]soildynamics_const_traction COMMAND Soildynamics Test.constant-traction.arc)
add_test(NAME [soildynamics]soildynamics_transient_traction COMMAND Soildynamics Test.transient-traction.arc)

if(FEMUTILS_HAS_SOLVER_BACKEND_PETSC)
add_test(NAME [soildynamics]soildynamics COMMAND Soildynamics Test.Soildynamics.arc)
add_test(NAME [soildynamics]soildynamics_const_traction COMMAND Soildynamics Test.constant-traction.arc)
add_test(NAME [soildynamics]soildynamics_transient_traction COMMAND Soildynamics Test.transient-traction.arc)
endif()

0 comments on commit 4661c9d

Please sign in to comment.