Update stand-alone tests to use test stage work directory (#24130)
This commit is contained in:
parent
d5d1d9548f
commit
a0259cc4f4
@ -61,20 +61,28 @@ def setup_smoke_tests(self):
|
|||||||
install test subdirectory for use during `spack test run`."""
|
install test subdirectory for use during `spack test run`."""
|
||||||
self.cache_extra_test_sources([self.examples_src_dir])
|
self.cache_extra_test_sources([self.examples_src_dir])
|
||||||
|
|
||||||
def test(self):
|
@property
|
||||||
example_src_dir = join_path(self.install_test_root,
|
def cached_tests_work_dir(self):
|
||||||
self.examples_src_dir)
|
"""The working directory for cached test sources."""
|
||||||
test_build_dir = join_path(self.test_suite.stage,
|
return join_path(self.test_suite.current_test_cache_dir,
|
||||||
'build_example')
|
self.examples_src_dir)
|
||||||
|
|
||||||
|
def test(self):
|
||||||
|
"""Perform stand-alone/smoke tests."""
|
||||||
cmake_args = [
|
cmake_args = [
|
||||||
self.define('CMAKE_PREFIX_PATH', self.prefix),
|
self.define('CMAKE_PREFIX_PATH', self.prefix),
|
||||||
self.define('CMAKE_Fortran_COMPILER', self.compiler.fc),
|
self.define('CMAKE_Fortran_COMPILER', self.compiler.fc),
|
||||||
]
|
]
|
||||||
cmake_args.append(example_src_dir)
|
cmake_args.append(self.cached_tests_work_dir)
|
||||||
with working_dir(test_build_dir, create=True):
|
|
||||||
cmake(*cmake_args)
|
self.run_test("cmake", cmake_args,
|
||||||
make()
|
purpose="test: calling cmake",
|
||||||
self.run_test(join_path(example_src_dir, 'run-examples.sh'),
|
work_dir=self.cached_tests_work_dir)
|
||||||
[], [], installed=False,
|
|
||||||
purpose='test: installation')
|
self.run_test("make", [],
|
||||||
|
purpose="test: building the tests",
|
||||||
|
work_dir=self.cached_tests_work_dir)
|
||||||
|
|
||||||
|
self.run_test("run-examples.sh", [],
|
||||||
|
purpose="test: running the examples",
|
||||||
|
work_dir=self.cached_tests_work_dir)
|
||||||
|
Loading…
Reference in New Issue
Block a user