openpmd-api: Changed from old to new test API (#44764)

* changed from old to new test API
* changed test name so it works
* small docstring change
* fixed skiptest check
* made tests check output
This commit is contained in:
AcriusWinter 2024-06-20 15:06:48 -07:00 committed by GitHub
parent 901f4b789d
commit 8f0b029308
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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