tests/mfem: convert to new stand-alone test process (#38011)

* mfem: convert to new stand-alone test process
* Restore make target, use config_mk property
This commit is contained in:
Tamara Dahlgren 2023-06-06 11:42:51 -07:00 committed by GitHub
parent 717fc11a46
commit 01c1d334ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1116,30 +1116,22 @@ def cache_test_sources(self):
make("examples/clean", parallel=False)
self.cache_extra_test_sources([self.examples_src_dir, self.examples_data_dir])
def test(self):
test_dir = join_path(self.test_suite.current_test_cache_dir, self.examples_src_dir)
def test_ex10(self):
"""build and run ex10(p)"""
# MFEM has many examples to serve as a suitable smoke check. ex10
# was chosen arbitrarily among the examples that work both with
# MPI and without it
test_exe = "ex10p" if ("+mpi" in self.spec) else "ex10"
self.run_test(
"make",
["CONFIG_MK={0}/share/mfem/config.mk".format(self.prefix), test_exe, "parallel=False"],
purpose="test: building {0}".format(test_exe),
skip_missing=False,
work_dir=test_dir,
)
test_dir = join_path(self.test_suite.current_test_cache_dir, self.examples_src_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,
)
mesh = join_path("..", self.examples_data_dir, "beam-quad.mesh")
test_exe = "ex10p" if ("+mpi" in self.spec) else "ex10"
with working_dir(test_dir):
make = which("make")
make(f"CONFIG_MK={self.config_mk}", test_exe, "parallel=False")
ex10 = which(test_exe)
ex10("--mesh", mesh)
# this patch is only needed for mfem 4.1, where a few
# released files include byte order marks