diff options
author | AcriusWinter <152348900+AcriusWinter@users.noreply.github.com> | 2024-07-18 15:06:45 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-18 16:06:45 -0600 |
commit | 6828a7402ace853b8cce03356e8ed841550da909 (patch) | |
tree | 5982b09260023e4d20f2600865acefac615a14d9 /var | |
parent | a0d62a40ddbf569ed87455a3ce20eedfbe37f7a8 (diff) | |
download | spack-6828a7402ace853b8cce03356e8ed841550da909.tar.gz spack-6828a7402ace853b8cce03356e8ed841550da909.tar.bz2 spack-6828a7402ace853b8cce03356e8ed841550da909.tar.xz spack-6828a7402ace853b8cce03356e8ed841550da909.zip |
improved-rdock: new test API (#45239)
* imoroved-rdock: new test API
* Make test subpart names and or descriptions more accurate
---------
Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/improved-rdock/package.py | 66 |
1 files changed, 37 insertions, 29 deletions
diff --git a/var/spack/repos/builtin/packages/improved-rdock/package.py b/var/spack/repos/builtin/packages/improved-rdock/package.py index 58aea89941..1adef52b67 100644 --- a/var/spack/repos/builtin/packages/improved-rdock/package.py +++ b/var/spack/repos/builtin/packages/improved-rdock/package.py @@ -63,33 +63,41 @@ class ImprovedRdock(MakefilePackage): def setup_run_environment(self, env): env.set("RBT_ROOT", self.prefix) - def test(self): + def test_rdock(self): + """improved-rdock test suite""" copy(join_path(self.prefix.example, "1sj0", "*"), ".") - opts = ["-r", "1sj0_rdock.prm", "-was"] - self.run_test("rbcavity", options=opts) - - mpiexe = self.spec["mpi"].prefix.bin.mpirun - opts = [ - self.prefix.bin.rbdock, - "-r", - "1sj0_rdock.prm", - "-p", - "dock.prm", - "-n", - "100", - "-i", - "1sj0_ligand.sd", - "-o", - "1sj0_docking_out", - "-s", - "1", - ] - self.run_test(str(mpiexe), options=opts) - - opts = [join_path(self.test_suite.current_test_data_dir, "test.sh")] - self.run_test("bash", options=opts) - - pythonexe = self.spec["python"].command.path - opts = [self.spec.prefix.bin.sdrmsd, "1sj0_ligand.sd", "1sj0_docking_out_sorted.sd"] - expected = ["1\t0.55", "100\t7.91"] - self.run_test(pythonexe, options=opts, expected=expected) + + with test_part(self, "test_rdock_rbcavity", purpose="Check rbcavity"): + rbcavity = which("rbcavity") + rbcavity("-r", "1sj0_rdock.prm", "-was") + + with test_part(self, "test_rdock_rbdock", purpose="Use mpirun to run rbdock in parallel"): + mpiexe = which(str(self.spec["mpi"].prefix.bin.mpirun)) + opts = [ + self.prefix.bin.rbdock, + "-r", + "1sj0_rdock.prm", + "-p", + "dock.prm", + "-n", + "100", + "-i", + "1sj0_ligand.sd", + "-o", + "1sj0_docking_out", + "-s", + "1", + ] + mpiexe(*opts) + + with test_part(self, "test_rdock_test_sh", purpose="Sort the output"): + bash = which("bash") + opts = [join_path(self.test_suite.current_test_data_dir, "test.sh")] + bash(*opts) + + with test_part(self, "test_rdock_sdrmsd", purpose="Check sdrmsd calculations"): + pythonexe = which(str(self.spec["python"].command.path)) + opts = [self.spec.prefix.bin.sdrmsd, "1sj0_ligand.sd", "1sj0_docking_out_sorted.sd"] + expected = ["1\t0.55", "100\t7.91"] + out = pythonexe(*opts, out=str.split, error=str.split) + check_outputs(expected, out) |