test(tests): added test suite
The test suite is extensive. Note that LLMs were used to aid in the development of the test suite. All LLM generated code was manually reviewed.
This commit is contained in:
@@ -1,11 +1,22 @@
|
||||
sandboxes = [
|
||||
'rayfem_sandbox',
|
||||
'discritization_sandbox',
|
||||
'eos_sandbox',
|
||||
'finite_sandbox',
|
||||
'dimensions_sandbox',
|
||||
'quadrature_sandbox',
|
||||
'meta_sandbox',
|
||||
'mapping_sandbox'
|
||||
'mapping_sandbox',
|
||||
'equations_sandbox',
|
||||
'geometry_sandbox',
|
||||
'surface_sandbox',
|
||||
'deformation_sandbox',
|
||||
'solver_sandbox',
|
||||
'complete_sandbox',
|
||||
'normalization_sandbox',
|
||||
'preconditioner_sandbox',
|
||||
'model_sandbox',
|
||||
'lane-emden_sandbox',
|
||||
]
|
||||
|
||||
expected_errors = {}
|
||||
@@ -18,12 +29,36 @@ foreach entry : get_option('sandbox_expected_errors')
|
||||
endforeach
|
||||
|
||||
foreach sandbox: sandboxes
|
||||
sandbox_timeout = sandbox in ['solver_sandbox', 'complete_sandbox'] ? 3600 : 30
|
||||
sandbox_cpp_args = []
|
||||
sandbox_link_depends = []
|
||||
sandbox_dependencies = [serif_dep, nameof_dep]
|
||||
sandbox_includes = []
|
||||
if sandbox == 'complete_sandbox'
|
||||
viewer_path = ''
|
||||
if rayfem_project.get_variable('build_viewer')
|
||||
viewer_target = rayfem_project.get_variable('rayfem_viewer')
|
||||
viewer_path = viewer_target.full_path()
|
||||
sandbox_link_depends += [viewer_target]
|
||||
endif
|
||||
sandbox_cpp_args += ['-DSERIF_RAYFEM_EXECUTABLE="' + viewer_path + '"']
|
||||
# Streamed frames report the vacuum virial measured by the solver tests.
|
||||
sandbox_dependencies += [stroid_dep]
|
||||
sandbox_includes += [include_directories('../include')]
|
||||
endif
|
||||
sandbox_exe = executable(
|
||||
sandbox,
|
||||
sandbox + '.cpp',
|
||||
dependencies: [serif_dep, stroid_dep, nameof_dep],
|
||||
dependencies: sandbox_dependencies,
|
||||
include_directories: sandbox_includes,
|
||||
cpp_args: sandbox_cpp_args,
|
||||
link_depends: sandbox_link_depends,
|
||||
build_rpath: mfem_runtime_prefix == '' ? '' : mfem_runtime_prefix / 'lib',
|
||||
)
|
||||
if sandbox in ['solver_sandbox', 'complete_sandbox'] and not mfem_has_mpi
|
||||
# These examples select the default AMG inverse, which requires MPI/Hypre.
|
||||
continue
|
||||
endif
|
||||
if expected_errors.has_key(sandbox)
|
||||
test(
|
||||
sandbox, python_build,
|
||||
@@ -32,6 +67,26 @@ foreach sandbox: sandboxes
|
||||
suite: 'sandbox',
|
||||
)
|
||||
else
|
||||
test(sandbox, sandbox_exe, workdir: meson.project_source_root(), suite: 'sandbox')
|
||||
test(sandbox, sandbox_exe, workdir: meson.project_source_root(), suite: 'sandbox', timeout: sandbox_timeout)
|
||||
endif
|
||||
endforeach
|
||||
|
||||
# This example uses only the dependency headers, independently of MFEM and SERiF linking.
|
||||
dependencies_sandbox = executable(
|
||||
'dependencies_sandbox',
|
||||
'dependencies_sandbox.cpp',
|
||||
dependencies: [magic_enum_dep],
|
||||
include_directories: include_dir,
|
||||
)
|
||||
test('dependencies_sandbox', dependencies_sandbox, suite: 'sandbox')
|
||||
|
||||
# Demonstrate archive ownership and continuation without leaving a file in the source tree.
|
||||
serialization_sandbox = executable(
|
||||
'serialization_sandbox',
|
||||
'serialization_sandbox.cpp',
|
||||
dependencies: [serif_dep],
|
||||
build_rpath: mfem_runtime_prefix == '' ? '' : mfem_runtime_prefix / 'lib',
|
||||
)
|
||||
if mfem_has_mpi
|
||||
test('serialization_sandbox', serialization_sandbox, suite: 'sandbox', timeout: 1800, is_parallel: false)
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user