From 7bd50e7b7acf87cb178775dc6dc782016ffa846c Mon Sep 17 00:00:00 2001 From: Jackson Lawrence Date: Mon, 8 Jul 2024 16:17:25 -0700 Subject: [PATCH] parsec: new test API --- .../repos/builtin/packages/parsec/package.py | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/var/spack/repos/builtin/packages/parsec/package.py b/var/spack/repos/builtin/packages/parsec/package.py index c98ba1336f42ca..aac9859c31f41c 100644 --- a/var/spack/repos/builtin/packages/parsec/package.py +++ b/var/spack/repos/builtin/packages/parsec/package.py @@ -104,15 +104,25 @@ def check(self): warn += "https://bitbucket.org/icldistcomp/parsec/issues" tty.msg(warn) - def test(self): + def test_parsec(self): """Compile and run a user program with the installed library""" with working_dir(join_path(self.install_test_root, "contrib/build_with_parsec")): - self.run_test( - "cmake", options=["."], purpose="Check if CMake can find PaRSEC and its targets" - ) - self.run_test("make", purpose="Check if tests can compile") - self.run_test("./dtd_test_allreduce") - self.run_test("./write_check") + + with test_part( + self, "test_parsec_cmake", purpose="Check if CMake can find PaRSEC and its targets" + ): + cmake = which("cmake") + cmake(".") + + with test_part(self, "test_parsec_make", purpose="Check if tests can compile"): + make = which("make") + make() + + programs = ["dtd_test_allreduce", "write_check"] + for program in programs: + with test_part(self, "test_parsec_" + program, purpose="Run " + program): + exe = which("./" + program) + exe() @run_after("install") def cache_test_sources(self):