summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorTamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>2021-06-03 19:31:51 -0700
committerGitHub <noreply@github.com>2021-06-04 02:31:51 +0000
commitfb05d9830a9eae528ec2ec0bcfb2a25433ff27a9 (patch)
tree4f66af7d027419b7ce1d6828980916cb91990487 /var
parent4ad779c4c443064291954b4eaa71cc12fe070062 (diff)
downloadspack-fb05d9830a9eae528ec2ec0bcfb2a25433ff27a9.tar.gz
spack-fb05d9830a9eae528ec2ec0bcfb2a25433ff27a9.tar.bz2
spack-fb05d9830a9eae528ec2ec0bcfb2a25433ff27a9.tar.xz
spack-fb05d9830a9eae528ec2ec0bcfb2a25433ff27a9.zip
formetis: Update stand-alone tests to use test stage work directory (#24133)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/formetis/package.py34
1 files changed, 22 insertions, 12 deletions
diff --git a/var/spack/repos/builtin/packages/formetis/package.py b/var/spack/repos/builtin/packages/formetis/package.py
index 6c8b0bd307..ee2f8593a8 100644
--- a/var/spack/repos/builtin/packages/formetis/package.py
+++ b/var/spack/repos/builtin/packages/formetis/package.py
@@ -21,7 +21,7 @@ class Formetis(CMakePackage):
variant('swig', default=False,
description='Regenerate source files using SWIG')
- depends_on('metis@5')
+ depends_on('metis@5:')
depends_on('parmetis', when='+mpi')
depends_on('mpi', when='+mpi')
depends_on('swig@4.0.2-fortran', when='+swig')
@@ -49,12 +49,14 @@ class Formetis(CMakePackage):
install test subdirectory for use during `spack test run`."""
self.cache_extra_test_sources([self.examples_src_dir])
- def test(self):
- example_src_dir = join_path(self.install_test_root,
- self.examples_src_dir)
- test_build_dir = join_path(self.test_suite.stage,
- 'build_example')
+ @property
+ def cached_tests_work_dir(self):
+ """The working directory for cached test sources."""
+ return join_path(self.test_suite.current_test_cache_dir,
+ self.examples_src_dir)
+ def test(self):
+ """Perform stand-alone/smoke tests on the installed package."""
cmake_args = [
self.define('CMAKE_PREFIX_PATH', self.prefix),
self.define('CMAKE_Fortran_COMPILER', self.compiler.fc),
@@ -63,9 +65,17 @@ class Formetis(CMakePackage):
if '+mpi' in self.spec:
cmake_args.append(
self.define('ParMETIS_ROOT', self.spec['parmetis'].prefix))
- cmake_args.append(example_src_dir)
- with working_dir(test_build_dir, create=True):
- cmake(*cmake_args)
- make()
- self.run_test('metis', [], [], installed=False,
- purpose='test: installation')
+ cmake_args.append(self.cached_tests_work_dir)
+
+ self.run_test("cmake", cmake_args,
+ purpose="test: calling cmake",
+ work_dir=self.cached_tests_work_dir)
+
+ self.run_test("make", [],
+ purpose="test: building the tests",
+ work_dir=self.cached_tests_work_dir)
+
+ self.run_test('metis', [], [],
+ purpose="test: checking the installation",
+ installed=False,
+ work_dir=self.cached_tests_work_dir)