diff options
author | AcriusWinter <152348900+AcriusWinter@users.noreply.github.com> | 2024-08-15 17:22:55 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-15 18:22:55 -0600 |
commit | b1b0c108bbc6daa5d3154b19a3d15507db60e4d3 (patch) | |
tree | 78a758156c24cc41f36a9db1bcd234996482139a /var | |
parent | c624088a7b77abef56be5280ca4a9de7c4fdf211 (diff) | |
download | spack-b1b0c108bbc6daa5d3154b19a3d15507db60e4d3.tar.gz spack-b1b0c108bbc6daa5d3154b19a3d15507db60e4d3.tar.bz2 spack-b1b0c108bbc6daa5d3154b19a3d15507db60e4d3.tar.xz spack-b1b0c108bbc6daa5d3154b19a3d15507db60e4d3.zip |
parsec: old to new test API (#45122)
* parsec: old to new test API
* parsec: restore stand-alone test subparts; preliminary test build fixes
---------
Co-authored-by: Tamara Dahlgren <dahlgren1@llnl.gov>
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/parsec/package.py | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/var/spack/repos/builtin/packages/parsec/package.py b/var/spack/repos/builtin/packages/parsec/package.py index c98ba1336f..faba983eea 100644 --- a/var/spack/repos/builtin/packages/parsec/package.py +++ b/var/spack/repos/builtin/packages/parsec/package.py @@ -104,17 +104,29 @@ class Parsec(CMakePackage, CudaPackage): warn += "https://bitbucket.org/icldistcomp/parsec/issues" tty.msg(warn) - def test(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") + contrib_dir = join_path("contrib", "build_with_parsec") + + def test_contrib(self): + """build and run contrib examples""" + with working_dir(join_path(self.test_suite.current_test_cache_dir, self.contrib_dir)): + cmake = self.spec["cmake"].command + args = [ + "-Wno-dev", + f"-DCMAKE_C_COMPILER={self.spec['mpi'].mpicc}", + f"-DCMAKE_PREFIX_PATH={self.prefix}", + ".", + ] + if "+cuda" in self.spec: + args.append("-DCUDA_TOOLKIT_ROOT_DIR:STRING=" + self.spec["cuda"].prefix) + + cmake(*args) + make() + + for name in ["dtd_test_allreduce", "write_check"]: + with test_part(self, f"test_contrib_{name}", f"run {name}"): + exe = which(name) + exe() @run_after("install") def cache_test_sources(self): - srcs = ["contrib/build_with_parsec"] - self.cache_extra_test_sources(srcs) + cache_extra_test_sources(self, self.contrib_dir) |