Skip to content

Commit

Permalink
Update examples and tests in meson.build
Browse files Browse the repository at this point in the history
  • Loading branch information
amontoison authored and jfowkes committed Jun 12, 2024
1 parent 24a87f4 commit 077bd63
Showing 1 changed file with 14 additions and 18 deletions.
32 changes: 14 additions & 18 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -191,41 +191,37 @@ if install_modules
meson.add_install_script(script_modules)
endif

# OMP-related environment variables
omp_env = ['OMP_CANCELLATION=true', 'OMP_PROC_BIND=true']

# Tests
if build_tests

fortran_tests_folder = 'tests/Fortran'
env = ['OMP_CANCELLATION=true', 'OMP_PROC_BIND=true']

foreach test: spral_tests
name = test[0]
file = test[1]
test(name,
executable(name, file, link_with : libspral, dependencies : libspral_deps, link_language : 'fortran',
include_directories: libspral_include, install : false, install_dir : fortran_tests_folder),
timeout : 300, is_parallel : false, env: env)
executable(name, file, link_with : libspral, dependencies : libspral_deps,
link_language : 'fortran', include_directories: libspral_include),
timeout : 300, is_parallel : false, env: omp_env)
endforeach

c_tests_folder = 'tests/C'

foreach test: spral_c_tests
name = test[0]
file = test[1]
test(name,
executable(name, file, link_with : libspral, dependencies : libspral_deps, link_language : 'c',
include_directories : libspral_include, install : false, install_dir : c_tests_folder),
timeout : 300, is_parallel : false, env: env)
executable(name, file, link_with : libspral, dependencies : libspral_deps,
link_language : 'c', include_directories : libspral_include),
timeout : 300, is_parallel : false, env: omp_env)
endforeach

cpp_tests_folder = 'tests/C++'

foreach test: spral_cpp_tests
name = test[0]
file = test[1]
test(name,
executable(name, file, link_with : libspral, dependencies : libspral_deps, link_language : 'cpp',
include_directories : libspral_include, install : false, install_dir : cpp_tests_folder),
timeout : 300, is_parallel : false, env: env)
executable(name, file, link_with : libspral, dependencies : libspral_deps,
link_language : 'cpp', include_directories : libspral_include),
timeout : 300, is_parallel : false, env: omp_env)
endforeach
endif

Expand All @@ -240,7 +236,7 @@ if build_examples
test(name,
executable(name, file, link_with : libspral, dependencies : libspral_deps, link_language : 'fortran',
include_directories : libspral_include, install : true, install_dir : fortran_examples_folder),
timeout : 300, is_parallel : false)
timeout : 300, is_parallel : false, env: omp_env)
endforeach

c_examples_folder = 'examples/C'
Expand All @@ -251,6 +247,6 @@ if build_examples
test(name,
executable(name, file, link_with : libspral, dependencies : libspral_deps, link_language : 'c',
include_directories : libspral_include, install : true, install_dir : c_examples_folder),
timeout : 300, is_parallel : false)
timeout : 300, is_parallel : false, env: omp_env)
endforeach
endif

0 comments on commit 077bd63

Please sign in to comment.