From ffd134c09d5682fdfe4969f051916c89fc6b25df Mon Sep 17 00:00:00 2001 From: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com> Date: Fri, 19 May 2023 05:05:23 -0700 Subject: [PATCH] formetis: converted to new stand-alone test process (#37785) --- .../builtin/packages/formetis/package.py | 29 +++++++------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/var/spack/repos/builtin/packages/formetis/package.py b/var/spack/repos/builtin/packages/formetis/package.py index 666037ccfa..71dd87d066 100644 --- a/var/spack/repos/builtin/packages/formetis/package.py +++ b/var/spack/repos/builtin/packages/formetis/package.py @@ -14,6 +14,8 @@ class Formetis(CMakePackage): maintainers("sethrj") + test_requires_compiler = True + version("0.0.2", sha256="0067c03ca822f4a3955751acb470f21eed489256e2ec5ff24741eb2b638592f1") variant("mpi", default=False, description="Enable ParMETIS support") @@ -53,8 +55,8 @@ 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.""" + def test_metis(self): + """build and run metis""" cmake_args = [ self.define("CMAKE_PREFIX_PATH", self.prefix), self.define("CMAKE_Fortran_COMPILER", self.compiler.fc), @@ -63,20 +65,11 @@ def test(self): if "+mpi" in self.spec: cmake_args.append(self.define("ParMETIS_ROOT", self.spec["parmetis"].prefix)) cmake_args.append(self.cached_tests_work_dir) + cmake = which(self.spec["cmake"].prefix.bin.cmake) + make = which("make") - 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, - ) + with working_dir(self.cached_tests_work_dir): + cmake(*cmake_args) + make() + metis = which("metis") + metis()