summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorTamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>2023-06-06 11:42:51 -0700
committerGitHub <noreply@github.com>2023-06-06 11:42:51 -0700
commit01c1d334ae71566353f1ea393f8745c1d6a7cecb (patch)
treebf21c1b6c47cc871d893cb66bd1cd41148b1caf8 /var
parent717fc11a46fc83b7c86250ccd1557fa9faa96580 (diff)
downloadspack-01c1d334ae71566353f1ea393f8745c1d6a7cecb.tar.gz
spack-01c1d334ae71566353f1ea393f8745c1d6a7cecb.tar.bz2
spack-01c1d334ae71566353f1ea393f8745c1d6a7cecb.tar.xz
spack-01c1d334ae71566353f1ea393f8745c1d6a7cecb.zip
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
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/mfem/package.py30
1 files 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