omega-h: reformatted from old test method to new test method (#44712)

* omega-h: reformatted from old test method to new test method
* omega-h: added proper output checking

--------
Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>
This commit is contained in:
AcriusWinter 2024-06-14 19:03:39 -07:00 committed by GitHub
parent db94696cf0
commit 456a8e3553
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -158,23 +158,27 @@ def flag_handler(self, name, flags):
return (None, None, flags) return (None, None, flags)
def test(self): def test_osh_box(self):
"""testing mesh construction"""
if self.spec.version < Version("9.34.1"): if self.spec.version < Version("9.34.1"):
print("Skipping tests since only relevant for versions > 9.34.1") raise SkipTest("Package must be installed as version 9.34.1 or later")
return exe = which(join_path(self.prefix.bin, "osh_box"))
exe = join_path(self.prefix.bin, "osh_box")
options = ["1", "1", "1", "2", "2", "2", "box.osh"] options = ["1", "1", "1", "2", "2", "2", "box.osh"]
description = "testing mesh construction" exe(*options)
self.run_test(exe, options, purpose=description)
exe = join_path(self.prefix.bin, "osh_scale") def test_osh_scale(self):
"""testing mesh adaptation"""
if self.spec.version < Version("9.34.1"):
raise SkipTest("Package must be installed as version 9.34.1 or later")
exe = which(join_path(self.prefix.bin, "osh_scale"))
options = ["box.osh", "100", "box_100.osh"] options = ["box.osh", "100", "box_100.osh"]
expected = "adapting took" actual = exe(*options, output=str.split, error=str.split)
description = "testing mesh adaptation" assert "adapting took" in actual
self.run_test(exe, options, expected, purpose=description)
exe = join_path(self.prefix.bin, "osh2vtk") def test_osh2vtk(self):
"""testing mesh to vtu conversion"""
if self.spec.version < Version("9.34.1"):
raise SkipTest("Package must be installed as version 9.34.1 or later")
exe = which(join_path(self.prefix.bin, "osh2vtk"))
options = ["box_100.osh", "box_100_vtk"] options = ["box_100.osh", "box_100_vtk"]
description = "testing mesh to vtu conversion" exe(*options)
self.run_test(exe, options, purpose=description)