hpctoolkit: convert to new stand-alone test process (#35752)
This commit is contained in:
parent
9a30ba1a4d
commit
585e150816
1 changed files with 20 additions and 15 deletions
|
@ -305,11 +305,12 @@ def setup_run_environment(self, env):
|
||||||
@run_after("install")
|
@run_after("install")
|
||||||
@on_package_attributes(run_tests=True)
|
@on_package_attributes(run_tests=True)
|
||||||
def check_install(self):
|
def check_install(self):
|
||||||
if self.spec.satisfies("@2022:"):
|
if not self.spec.satisfies("@2022:"):
|
||||||
with working_dir("tests"):
|
tty.warn("requires 2022.01.15 or later")
|
||||||
make("check")
|
return
|
||||||
else:
|
|
||||||
tty.warn("spack test for hpctoolkit requires 2022.01.15 or later")
|
with working_dir("tests"):
|
||||||
|
make("check")
|
||||||
|
|
||||||
# Post-Install tests (spack test run). These are the same tests
|
# Post-Install tests (spack test run). These are the same tests
|
||||||
# but with a different Makefile that works outside the build
|
# but with a different Makefile that works outside the build
|
||||||
|
@ -319,13 +320,17 @@ def copy_test_files(self):
|
||||||
if self.spec.satisfies("@2022:"):
|
if self.spec.satisfies("@2022:"):
|
||||||
self.cache_extra_test_sources(["tests"])
|
self.cache_extra_test_sources(["tests"])
|
||||||
|
|
||||||
def test(self):
|
def test_run_sort(self):
|
||||||
test_dir = join_path(self.test_suite.current_test_cache_dir, "tests")
|
"""build and run selection sort unit test"""
|
||||||
if self.spec.satisfies("@2022:"):
|
if not self.spec.satisfies("@2022:"):
|
||||||
with working_dir(test_dir):
|
raise SkipTest("No tests exist for versions prior to 2022.01.15")
|
||||||
make("-f", "Makefile.spack", "all")
|
|
||||||
self.run_test(
|
test_dir = self.test_suite.current_test_cache_dir.tests
|
||||||
"./run-sort", status=[0], installed=False, purpose="selection sort unit test"
|
with working_dir(test_dir):
|
||||||
)
|
make = which("make")
|
||||||
else:
|
make("-f", "Makefile.spack", "all")
|
||||||
tty.warn("spack test for hpctoolkit requires 2022.01.15 or later")
|
|
||||||
|
run_sort = which(join_path(".", "run-sort"))
|
||||||
|
assert run_sort, "run-sort is missing"
|
||||||
|
|
||||||
|
run_sort()
|
||||||
|
|
Loading…
Reference in a new issue