pumi: new test API (#45181)

* pumi: new test API

---------

Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>
This commit is contained in:
AcriusWinter 2024-07-10 16:57:05 -07:00 committed by GitHub
parent 2eb566b884
commit 12e7c1569c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -111,25 +111,34 @@ def cmake_args(self):
args.append("-DSIM_DISCRETE=ON") args.append("-DSIM_DISCRETE=ON")
return args return args
def test(self): def test_partition(self):
if self.spec.version <= Version("2.2.6"): """Testing pumi mesh partitioning"""
return if self.spec.satisfies("@:2.2.6"):
exe = "uniform" raise SkipTest("Package must be installed as version @2.2.7 or later")
options = ["../testdata/pipe.dmg", "../testdata/pipe.smb", "pipe_unif.smb"]
expected = "mesh pipe_unif.smb written"
description = "testing pumi uniform mesh refinement"
self.run_test(exe, options, expected, purpose=description, work_dir=self.prefix.bin)
mpiexec = Executable(join_path(self.spec["mpi"].prefix.bin, "mpiexec")).command options = [
mpiopt = ["-n", "2"] "-n",
exe = ["split"] "2",
options = ["../testdata/pipe.dmg", "../testdata/pipe.smb", "pipe_2_.smb", "2"] join_path(self.prefix.bin, "split"),
expected = "mesh pipe_2_.smb written" join_path(self.prefix.share.testdata, "pipe.dmg"),
description = "testing pumi mesh partitioning" join_path(self.prefix.share.testdata, "pipe.smb"),
self.run_test( "pipe_2_.smb",
mpiexec, "2",
mpiopt + exe + options, ]
expected, exe = which(self.spec["mpi"].prefix.bin.mpiexec)
purpose=description, out = exe(*options, output=str.split, error=str.split)
work_dir=self.prefix.bin, assert "mesh pipe_2_.smb written" in out
)
def test_refine(self):
"""Testing pumi uniform mesh refinement"""
if self.spec.satisfies("@:2.2.6"):
raise SkipTest("Package must be installed as version @2.2.7 or later")
options = [
join_path(self.prefix.share.testdata, "pipe.dmg"),
join_path(self.prefix.share.testdata, "pipe.smb"),
"pipe_unif.smb",
]
exe = which(self.prefix.bin.uniform)
out = exe(*options, output=str.split, error=str.split)
assert "mesh pipe_unif.smb written" in out