summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAcriusWinter <152348900+AcriusWinter@users.noreply.github.com>2024-07-10 16:57:05 -0700
committerGitHub <noreply@github.com>2024-07-10 17:57:05 -0600
commit12e7c1569c65198e6e88d77c8fa5b9ca0337239f (patch)
tree812e8d3ef358c39f6214469708b402f5da96c45e
parent2eb566b884b9fa89dc3e9c1f7eeb5c21618a1817 (diff)
downloadspack-12e7c1569c65198e6e88d77c8fa5b9ca0337239f.tar.gz
spack-12e7c1569c65198e6e88d77c8fa5b9ca0337239f.tar.bz2
spack-12e7c1569c65198e6e88d77c8fa5b9ca0337239f.tar.xz
spack-12e7c1569c65198e6e88d77c8fa5b9ca0337239f.zip
pumi: new test API (#45181)
* pumi: new test API --------- Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>
-rw-r--r--var/spack/repos/builtin/packages/pumi/package.py53
1 files changed, 31 insertions, 22 deletions
diff --git a/var/spack/repos/builtin/packages/pumi/package.py b/var/spack/repos/builtin/packages/pumi/package.py
index f06b007833..4ccfcadf25 100644
--- a/var/spack/repos/builtin/packages/pumi/package.py
+++ b/var/spack/repos/builtin/packages/pumi/package.py
@@ -111,25 +111,34 @@ class Pumi(CMakePackage):
args.append("-DSIM_DISCRETE=ON")
return args
- def test(self):
- if self.spec.version <= Version("2.2.6"):
- return
- exe = "uniform"
- 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
- mpiopt = ["-n", "2"]
- exe = ["split"]
- options = ["../testdata/pipe.dmg", "../testdata/pipe.smb", "pipe_2_.smb", "2"]
- expected = "mesh pipe_2_.smb written"
- description = "testing pumi mesh partitioning"
- self.run_test(
- mpiexec,
- mpiopt + exe + options,
- expected,
- purpose=description,
- work_dir=self.prefix.bin,
- )
+ def test_partition(self):
+ """Testing pumi mesh partitioning"""
+ if self.spec.satisfies("@:2.2.6"):
+ raise SkipTest("Package must be installed as version @2.2.7 or later")
+
+ options = [
+ "-n",
+ "2",
+ join_path(self.prefix.bin, "split"),
+ join_path(self.prefix.share.testdata, "pipe.dmg"),
+ join_path(self.prefix.share.testdata, "pipe.smb"),
+ "pipe_2_.smb",
+ "2",
+ ]
+ exe = which(self.spec["mpi"].prefix.bin.mpiexec)
+ out = exe(*options, output=str.split, error=str.split)
+ 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