summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>2023-06-14 11:54:47 -0700
committerGitHub <noreply@github.com>2023-06-14 11:54:47 -0700
commit62525d907619b5651d803fec1a9b40fd98c8d50b (patch)
treecb0dd96ce656bdc35645916be3ef9da6de8b1421
parentc2371263d1b4da3661b4882bfe013e1ccd9d58dc (diff)
downloadspack-62525d907619b5651d803fec1a9b40fd98c8d50b.tar.gz
spack-62525d907619b5651d803fec1a9b40fd98c8d50b.tar.bz2
spack-62525d907619b5651d803fec1a9b40fd98c8d50b.tar.xz
spack-62525d907619b5651d803fec1a9b40fd98c8d50b.zip
dsqss: convert to new stand-alone test process (#38372)
-rw-r--r--var/spack/repos/builtin/packages/dsqss/package.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/var/spack/repos/builtin/packages/dsqss/package.py b/var/spack/repos/builtin/packages/dsqss/package.py
index 1761e36d8d..ae92627bca 100644
--- a/var/spack/repos/builtin/packages/dsqss/package.py
+++ b/var/spack/repos/builtin/packages/dsqss/package.py
@@ -50,13 +50,17 @@ class Dsqss(CMakePackage):
return args
- def test(self):
+ def test_dla(self):
+ """prepare, run, and confirm dla results"""
test01 = find(self.prefix.share, "01_spindimer")[0]
copy(join_path(test01, "std.toml"), ".")
+
# prepare
- pythonexe = self.spec["python"].command.path
+ python = self.spec["python"].command
opts = [self.spec.prefix.bin.dla_pre, "std.toml"]
- self.run_test(pythonexe, options=opts)
+ with test_part(self, "test_dla_pre", purpose="prepare dla"):
+ python(*opts)
+
# (mpi) run
opts = []
if self.spec.satisfies("+mpi"):
@@ -66,6 +70,11 @@ class Dsqss(CMakePackage):
else:
exe_name = "dla"
opts.append("param.in")
- expected = ["R ene = -3.74300000e-01 2.96344394e-03"]
- self.run_test(exe_name, options=opts)
- self.run_test("cat", options=["sample.log"], expected=expected)
+ with test_part(self, "test_dla_run", purpose="run dla"):
+ exe = which(exe_name)
+ exe(*opts)
+
+ with test_part(self, "test_dla_results", purpose="confirming dla results"):
+ cat = which("cat")
+ out = cat("sample.log", output=str.split, error=str.split)
+ assert "R ene = -3.74300000e-01 2.96344394e-03" in out