Skip to content

Commit

Permalink
openpmd-api: Changed from old to new test API (spack#44764)
Browse files Browse the repository at this point in the history
* changed from old to new test API
* changed test name so it works
* small docstring change
* fixed skiptest check
* made tests check output
  • Loading branch information
AcriusWinter authored Jun 20, 2024
1 parent 901f4b7 commit 8f0b029
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions var/spack/repos/builtin/packages/openpmd-api/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,17 +172,10 @@ def check(self):
# later tests
ctest("--output-on-failure", "-j1")

def test(self):
"""Perform smoke tests on the installed package."""
exes = ["openpmd-ls"] # in 0.11.1+
for exe in exes:
spec_vers_str = "{0}".format(self.spec.version)
reason = "test version of {0} is {1}".format(exe, spec_vers_str)
self.run_test(
exe,
["--version"],
[spec_vers_str],
installed=True,
purpose=reason,
skip_missing=False,
)
def test_run_openpmd_ls(self):
"""Test if openpmd-ls runs correctly"""
if self.spec.satisfies("@:0.11.0"):
raise SkipTest("Package must be installed as version 0.11.1 or later")
exe = which(join_path(self.prefix.bin, "openpmd-ls"))
out = exe(output=str.split, error=str.split)
assert str(self.spec.version) in out

0 comments on commit 8f0b029

Please sign in to comment.