mfem: Update stand-alone test to use test stage directory (#25744)

This commit is contained in:
Tamara Dahlgren 2021-09-02 14:52:56 -07:00 committed by GitHub
parent f71d93fc55
commit 487edcc416
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -806,20 +806,39 @@ def cache_test_sources(self):
self.examples_data_dir]) self.examples_data_dir])
def test(self): def test(self):
test_dir = join_path(self.install_test_root, self.examples_src_dir) test_dir = join_path(
with working_dir(test_dir, create=False): self.test_suite.current_test_cache_dir,
self.examples_src_dir
)
# MFEM has many examples to serve as a suitable smoke check. ex10 # MFEM has many examples to serve as a suitable smoke check. ex10
# was chosen arbitrarily among the examples that work both with # was chosen arbitrarily among the examples that work both with
# MPI and without it # MPI and without it
test_exe = 'ex10p' if ('+mpi' in self.spec) else 'ex10' test_exe = 'ex10p' if ('+mpi' in self.spec) else 'ex10'
make('CONFIG_MK={0}/share/mfem/config.mk'.format(self.prefix), self.run_test(
test_exe, parallel=False) 'make',
self.run_test('./{0}'.format(test_exe), [
['--mesh', '../{0}/beam-quad.mesh'.format( 'CONFIG_MK={0}/share/mfem/config.mk'.format(self.prefix),
self.examples_data_dir)], test_exe,
[], installed=True, purpose='Smoke test for mfem', 'parallel=False'
skip_missing=False, work_dir='.') ],
make('clean') purpose='test: building {0}'.format(test_exe),
skip_missing=False,
work_dir=test_dir,
)
self.run_test(
'./{0}'.format(test_exe),
[
'--mesh',
'../{0}/beam-quad.mesh'.format(self.examples_data_dir)
],
[],
installed=False,
purpose='test: running {0}'.format(test_exe),
skip_missing=False,
work_dir=test_dir,
)
# this patch is only needed for mfem 4.1, where a few # this patch is only needed for mfem 4.1, where a few
# released files include byte order marks # released files include byte order marks