formetis: converted to new stand-alone test process (#37785)

This commit is contained in:
Tamara Dahlgren 2023-05-19 05:05:23 -07:00 committed by GitHub
parent bfadd5c9a5
commit ffd134c09d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,6 +14,8 @@ class Formetis(CMakePackage):
maintainers("sethrj") maintainers("sethrj")
test_requires_compiler = True
version("0.0.2", sha256="0067c03ca822f4a3955751acb470f21eed489256e2ec5ff24741eb2b638592f1") version("0.0.2", sha256="0067c03ca822f4a3955751acb470f21eed489256e2ec5ff24741eb2b638592f1")
variant("mpi", default=False, description="Enable ParMETIS support") 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.""" """The working directory for cached test sources."""
return join_path(self.test_suite.current_test_cache_dir, self.examples_src_dir) return join_path(self.test_suite.current_test_cache_dir, self.examples_src_dir)
def test(self): def test_metis(self):
"""Perform stand-alone/smoke tests on the installed package.""" """build and run metis"""
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),
@ -63,20 +65,11 @@ def test(self):
if "+mpi" in self.spec: if "+mpi" in self.spec:
cmake_args.append(self.define("ParMETIS_ROOT", self.spec["parmetis"].prefix)) cmake_args.append(self.define("ParMETIS_ROOT", self.spec["parmetis"].prefix))
cmake_args.append(self.cached_tests_work_dir) cmake_args.append(self.cached_tests_work_dir)
cmake = which(self.spec["cmake"].prefix.bin.cmake)
make = which("make")
self.run_test( with working_dir(self.cached_tests_work_dir):
"cmake", cmake_args, purpose="test: calling cmake", work_dir=self.cached_tests_work_dir cmake(*cmake_args)
) make()
metis = which("metis")
self.run_test( metis()
"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,
)