diff options
author | Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com> | 2023-06-24 06:44:14 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-24 15:44:14 +0200 |
commit | 585e1508168d659042e14fb20e86a5d7cd74c91f (patch) | |
tree | 9dfeaf3ab68e8eb000c476093df697bdac79e9e3 /var | |
parent | 9a30ba1a4d99f3c185368d612242ad309afa235c (diff) | |
download | spack-585e1508168d659042e14fb20e86a5d7cd74c91f.tar.gz spack-585e1508168d659042e14fb20e86a5d7cd74c91f.tar.bz2 spack-585e1508168d659042e14fb20e86a5d7cd74c91f.tar.xz spack-585e1508168d659042e14fb20e86a5d7cd74c91f.zip |
hpctoolkit: convert to new stand-alone test process (#35752)
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/hpctoolkit/package.py | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/var/spack/repos/builtin/packages/hpctoolkit/package.py b/var/spack/repos/builtin/packages/hpctoolkit/package.py index d4eaaf482b..1e342f326a 100644 --- a/var/spack/repos/builtin/packages/hpctoolkit/package.py +++ b/var/spack/repos/builtin/packages/hpctoolkit/package.py @@ -305,11 +305,12 @@ class Hpctoolkit(AutotoolsPackage): @run_after("install") @on_package_attributes(run_tests=True) def check_install(self): - if self.spec.satisfies("@2022:"): - with working_dir("tests"): - make("check") - else: - tty.warn("spack test for hpctoolkit requires 2022.01.15 or later") + if not self.spec.satisfies("@2022:"): + tty.warn("requires 2022.01.15 or later") + return + + with working_dir("tests"): + make("check") # Post-Install tests (spack test run). These are the same tests # but with a different Makefile that works outside the build @@ -319,13 +320,17 @@ class Hpctoolkit(AutotoolsPackage): if self.spec.satisfies("@2022:"): self.cache_extra_test_sources(["tests"]) - def test(self): - test_dir = join_path(self.test_suite.current_test_cache_dir, "tests") - if self.spec.satisfies("@2022:"): - with working_dir(test_dir): - make("-f", "Makefile.spack", "all") - self.run_test( - "./run-sort", status=[0], installed=False, purpose="selection sort unit test" - ) - else: - tty.warn("spack test for hpctoolkit requires 2022.01.15 or later") + def test_run_sort(self): + """build and run selection sort unit test""" + if not self.spec.satisfies("@2022:"): + raise SkipTest("No tests exist for versions prior to 2022.01.15") + + test_dir = self.test_suite.current_test_cache_dir.tests + with working_dir(test_dir): + make = which("make") + make("-f", "Makefile.spack", "all") + + run_sort = which(join_path(".", "run-sort")) + assert run_sort, "run-sort is missing" + + run_sort() |