From 62525d907619b5651d803fec1a9b40fd98c8d50b Mon Sep 17 00:00:00 2001 From: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com> Date: Wed, 14 Jun 2023 11:54:47 -0700 Subject: [PATCH] dsqss: convert to new stand-alone test process (#38372) --- .../repos/builtin/packages/dsqss/package.py | 21 +++++++++++++------ 1 file 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 @@ 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"): @@ -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