diff options
author | AcriusWinter <152348900+AcriusWinter@users.noreply.github.com> | 2024-07-15 20:10:50 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-15 21:10:50 -0600 |
commit | d85668f096872c406e5e03064551c66110bc7f42 (patch) | |
tree | 6f670556aeacaf28ad8a10598c000bc87b90deea /var | |
parent | 5c3a23a481938e59e495cf1fd4e9d45899a4d23a (diff) | |
download | spack-d85668f096872c406e5e03064551c66110bc7f42.tar.gz spack-d85668f096872c406e5e03064551c66110bc7f42.tar.bz2 spack-d85668f096872c406e5e03064551c66110bc7f42.tar.xz spack-d85668f096872c406e5e03064551c66110bc7f42.zip |
slate: changed stand-alone test from old to new API (#44953)
* slate: changed from old to new format
* make code tighter
* replace assert method
* SkipTest plus other cleanup
---------
Co-authored-by: Tamara Dahlgren <dahlgren1@llnl.gov>
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/slate/package.py | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/var/spack/repos/builtin/packages/slate/package.py b/var/spack/repos/builtin/packages/slate/package.py index 4a04e4af96..80f5a98097 100644 --- a/var/spack/repos/builtin/packages/slate/package.py +++ b/var/spack/repos/builtin/packages/slate/package.py @@ -165,25 +165,26 @@ class Slate(CMakePackage, CudaPackage, ROCmPackage): commands = ["srun", "mpirun", "mpiexec"] return which(*commands, path=searchpath) or which(*commands) - def test(self): + def test_example(self): + """build and run slate example""" + if self.spec.satisfies("@2020.10.00") or "+mpi" not in self.spec: - print("Skipping: stand-alone tests") - return + raise SkipTest("Package must be installed with +mpi and version @2021.05.01 or later") test_dir = join_path(self.test_suite.current_test_cache_dir, "examples", "build") with working_dir(test_dir, create=True): - cmake_bin = join_path(self.spec["cmake"].prefix.bin, "cmake") + cmake = self.spec["cmake"].command + # This package must directly depend on all packages listed here. # Otherwise, it will not work when some packages are external to spack. deps = "slate blaspp lapackpp mpi" if self.spec.satisfies("+rocm"): deps += " rocblas hip llvm-amdgpu comgr hsa-rocr-dev rocsolver " prefixes = ";".join([self.spec[x].prefix for x in deps.split()]) - self.run_test(cmake_bin, ["-DCMAKE_PREFIX_PATH=" + prefixes, ".."]) + + cmake("-DCMAKE_PREFIX_PATH=" + prefixes, "..") + make = which("make") make() - test_args = ["-n", "4", "./ex05_blas"] launcher = self.mpi_launcher() - if not launcher: - raise RuntimeError("Cannot run tests due to absence of MPI launcher") - self.run_test(launcher.command, test_args, purpose="SLATE smoke test") - make("clean") + assert launcher is not None, "Cannot run tests due to absence of MPI launcher" + launcher("-n", "4", "./ex05_blas") |