From e9e5beee1f066d1ac211740d1d0dbda6154b6e1e Mon Sep 17 00:00:00 2001 From: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com> Date: Fri, 19 May 2023 05:06:33 -0700 Subject: [PATCH] fortrilinos: convert to new stand-alone test process (#37783) --- .../builtin/packages/fortrilinos/package.py | 27 +++++++------------ 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/var/spack/repos/builtin/packages/fortrilinos/package.py b/var/spack/repos/builtin/packages/fortrilinos/package.py index ca7c7ace51..0ed163705b 100644 --- a/var/spack/repos/builtin/packages/fortrilinos/package.py +++ b/var/spack/repos/builtin/packages/fortrilinos/package.py @@ -91,27 +91,20 @@ def setup_smoke_tests(self): install test subdirectory for use during `spack test run`.""" self.cache_extra_test_sources([self.examples_src_dir]) - def test(self): - """Perform stand-alone/smoke tests using installed package.""" + def test_installation(self): + """build and run ctest against the installed software""" cmake_args = [ self.define("CMAKE_PREFIX_PATH", self.prefix), self.define("CMAKE_CXX_COMPILER", self.compiler.cxx), self.define("CMAKE_Fortran_COMPILER", self.compiler.fc), self.cached_tests_work_dir, ] - self.run_test( - "cmake", cmake_args, purpose="test: calling cmake", work_dir=self.cached_tests_work_dir - ) + cmake = which(self.spec["cmake"].prefix.bin.cmake) + ctest = which("ctest") + make = which("make") - self.run_test( - "make", [], purpose="test: calling make", work_dir=self.cached_tests_work_dir - ) - - self.run_test( - "ctest", - ["-V"], - ["100% tests passed"], - installed=False, - purpose="test: testing the installation", - work_dir=self.cached_tests_work_dir, - ) + with working_dir(self.cached_tests_work_dir, create=True): + cmake(*cmake_args) + make() + out = ctest("-V", output=str.split, error=str.split) + assert "100% tests passed" in out