From 456a8e3553987c60a18d4a49cb5c088f5c59c5de Mon Sep 17 00:00:00 2001 From: AcriusWinter <152348900+AcriusWinter@users.noreply.github.com> Date: Fri, 14 Jun 2024 19:03:39 -0700 Subject: 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> --- .../repos/builtin/packages/omega-h/package.py | 32 ++++++++++++---------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/omega-h/package.py b/var/spack/repos/builtin/packages/omega-h/package.py index 25887e0491..17fdeed247 100644 --- a/var/spack/repos/builtin/packages/omega-h/package.py +++ b/var/spack/repos/builtin/packages/omega-h/package.py @@ -158,23 +158,27 @@ class OmegaH(CMakePackage, CudaPackage): return (None, None, flags) - def test(self): + def test_osh_box(self): + """testing mesh construction""" if self.spec.version < Version("9.34.1"): - print("Skipping tests since only relevant for versions > 9.34.1") - return - - exe = join_path(self.prefix.bin, "osh_box") + raise SkipTest("Package must be installed as version 9.34.1 or later") + exe = which(join_path(self.prefix.bin, "osh_box")) options = ["1", "1", "1", "2", "2", "2", "box.osh"] - description = "testing mesh construction" - self.run_test(exe, options, purpose=description) + exe(*options) - 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"] - expected = "adapting took" - description = "testing mesh adaptation" - self.run_test(exe, options, expected, purpose=description) + actual = exe(*options, output=str.split, error=str.split) + assert "adapting took" in actual - 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"] - description = "testing mesh to vtu conversion" - self.run_test(exe, options, purpose=description) + exe(*options) -- cgit v1.2.3-70-g09d2