diff options
author | Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com> | 2021-09-02 14:52:56 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-02 14:52:56 -0700 |
commit | 487edcc4160158d06f8a52fbd4abf0d352f0d3d3 (patch) | |
tree | a0d8ab31fcad86d55a0a3d6472353c1ee3015cee | |
parent | f71d93fc55f2aaf955a31779b2fd2d0bbd17a37a (diff) | |
download | spack-487edcc4160158d06f8a52fbd4abf0d352f0d3d3.tar.gz spack-487edcc4160158d06f8a52fbd4abf0d352f0d3d3.tar.bz2 spack-487edcc4160158d06f8a52fbd4abf0d352f0d3d3.tar.xz spack-487edcc4160158d06f8a52fbd4abf0d352f0d3d3.zip |
mfem: Update stand-alone test to use test stage directory (#25744)
-rw-r--r-- | var/spack/repos/builtin/packages/mfem/package.py | 47 |
1 files changed, 33 insertions, 14 deletions
diff --git a/var/spack/repos/builtin/packages/mfem/package.py b/var/spack/repos/builtin/packages/mfem/package.py index ecd470c4cb..6d004447cd 100644 --- a/var/spack/repos/builtin/packages/mfem/package.py +++ b/var/spack/repos/builtin/packages/mfem/package.py @@ -806,20 +806,39 @@ class Mfem(Package, CudaPackage, ROCmPackage): self.examples_data_dir]) def test(self): - test_dir = join_path(self.install_test_root, self.examples_src_dir) - with working_dir(test_dir, create=False): - # 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' - make('CONFIG_MK={0}/share/mfem/config.mk'.format(self.prefix), - test_exe, parallel=False) - self.run_test('./{0}'.format(test_exe), - ['--mesh', '../{0}/beam-quad.mesh'.format( - self.examples_data_dir)], - [], installed=True, purpose='Smoke test for mfem', - skip_missing=False, work_dir='.') - make('clean') + test_dir = join_path( + self.test_suite.current_test_cache_dir, + self.examples_src_dir + ) + + # 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, + ) + + 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 # released files include byte order marks |