summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/arborx/package.py
diff options
context:
space:
mode:
authorTamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>2021-06-07 09:11:10 -0700
committerGitHub <noreply@github.com>2021-06-07 18:11:10 +0200
commit026cf7aa306383e42397b4e5f176db81f956136e (patch)
tree79e80e978096b049cdb441e7db099baf9804156d /var/spack/repos/builtin/packages/arborx/package.py
parente12b030def9311dd5d01283afbed52eff7ec4f2c (diff)
downloadspack-026cf7aa306383e42397b4e5f176db81f956136e.tar.gz
spack-026cf7aa306383e42397b4e5f176db81f956136e.tar.bz2
spack-026cf7aa306383e42397b4e5f176db81f956136e.tar.xz
spack-026cf7aa306383e42397b4e5f176db81f956136e.zip
Update stand-alone tests to use test stage work directory (#24110)
Diffstat (limited to 'var/spack/repos/builtin/packages/arborx/package.py')
-rw-r--r--var/spack/repos/builtin/packages/arborx/package.py49
1 files changed, 29 insertions, 20 deletions
diff --git a/var/spack/repos/builtin/packages/arborx/package.py b/var/spack/repos/builtin/packages/arborx/package.py
index 8790e7b14c..3ce4582f9b 100644
--- a/var/spack/repos/builtin/packages/arborx/package.py
+++ b/var/spack/repos/builtin/packages/arborx/package.py
@@ -78,32 +78,41 @@ class Arborx(CMakePackage):
install test subdirectory for use during `spack test run`."""
self.cache_extra_test_sources([self.examples_src_dir])
+ @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 build_tests(self):
- """Build test."""
- cmake_build_path = join_path(self.install_test_root,
- self.examples_src_dir, "build")
- cmake_prefix_path = "-DCMAKE_PREFIX_PATH={0}".format(self.spec['arborx'].prefix)
+ """Build the stand-alone/smoke test."""
- # We don't need to append the path to Kokkos to CMAKE_PREFIX_PATH
- # since a hint is already hardcoded inside the CMake ArborX configuration.
+ # We don't need to append the path to Kokkos to CMAKE_PREFIX_PATH since
+ # a hint is already hardcoded inside the CMake ArborX configuration.
# Omitting it here allows us to avoid to distinguish between Kokkos
# being installed as a standalone or as part of Trilinos.
+ arborx_dir = self.spec['arborx'].prefix
+ cmake_prefix_path = "-DCMAKE_PREFIX_PATH={0}".format(arborx_dir)
if '+mpi' in self.spec:
cmake_prefix_path += ";{0}".format(self.spec['mpi'].prefix)
- with working_dir(cmake_build_path, create=True):
- cmake_args = ["..",
- cmake_prefix_path,
- "-DCMAKE_CXX_COMPILER={0}".format(self.compiler.cxx)]
- cmake(*cmake_args)
- make()
-
- def run_tests(self):
- """Run test."""
- reason = 'Checking ability to execute.'
- run_path = join_path(self.install_test_root, self.examples_src_dir, 'build')
- with working_dir(run_path):
- self.run_test('ctest', ['-V'], [], installed=False, purpose=reason)
+
+ cmake_args = [".",
+ cmake_prefix_path,
+ "-DCMAKE_CXX_COMPILER={0}".format(self.compiler.cxx)]
+
+ 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)
def test(self):
+ """Perform stand-alone/smoke tests on the installed package."""
self.build_tests()
- self.run_tests()
+
+ self.run_test("ctest", ["-V"],
+ purpose="test: running the tests",
+ installed=False,
+ work_dir=self.cached_tests_work_dir)