Skip to content

Commit

Permalink
dsqss: convert to new stand-alone test process (spack#38372)
Browse files Browse the repository at this point in the history
  • Loading branch information
tldahlgren authored Jun 14, 2023
1 parent c237126 commit 62525d9
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions var/spack/repos/builtin/packages/dsqss/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,17 @@ def cmake_args(self):

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"):
Expand All @@ -66,6 +70,11 @@ def test(self):
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

0 comments on commit 62525d9

Please sign in to comment.