From 01c1d334ae71566353f1ea393f8745c1d6a7cecb Mon Sep 17 00:00:00 2001 From: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com> Date: Tue, 6 Jun 2023 11:42:51 -0700 Subject: 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 --- var/spack/repos/builtin/packages/mfem/package.py | 30 +++++++++--------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/var/spack/repos/builtin/packages/mfem/package.py b/var/spack/repos/builtin/packages/mfem/package.py index dbd917f0a9..b3b8daad4b 100644 --- a/var/spack/repos/builtin/packages/mfem/package.py +++ b/var/spack/repos/builtin/packages/mfem/package.py @@ -1116,30 +1116,22 @@ class Mfem(Package, CudaPackage, ROCmPackage): 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_dir = join_path(self.test_suite.current_test_cache_dir, self.examples_src_dir) + + mesh = join_path("..", self.examples_data_dir, "beam-quad.mesh") 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, - ) - 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, - ) + 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 -- cgit v1.2.3-70-g09d2