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,
# MFEM has many examples to serve as a suitable smoke check. ex10 self.examples_src_dir
# was chosen arbitrarily among the examples that work both with )
# MPI and without it
test_exe = 'ex10p' if ('+mpi' in self.spec) else 'ex10' # MFEM has many examples to serve as a suitable smoke check. ex10
make('CONFIG_MK={0}/share/mfem/config.mk'.format(self.prefix), # was chosen arbitrarily among the examples that work both with
test_exe, parallel=False) # MPI and without it
self.run_test('./{0}'.format(test_exe), test_exe = 'ex10p' if ('+mpi' in self.spec) else 'ex10'
['--mesh', '../{0}/beam-quad.mesh'.format( self.run_test(
self.examples_data_dir)], 'make',
[], installed=True, purpose='Smoke test for mfem', [
skip_missing=False, work_dir='.') 'CONFIG_MK={0}/share/mfem/config.mk'.format(self.prefix),
make('clean') test_exe,
'parallel=False'
],
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