summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortakanori-ihara <62980219+takanori-ihara@users.noreply.github.com>2021-02-10 05:33:55 +0900
committerGitHub <noreply@github.com>2021-02-09 12:33:55 -0800
commitfe863b68b2c44f8f3152ed40f9f50d11d6bfc1ec (patch)
tree5abf85660d3b639a77f60f7b0638bbfc5b15fe0e
parent02a4abadfa46cb1d7dd0b26da8e946197957e6dd (diff)
downloadspack-fe863b68b2c44f8f3152ed40f9f50d11d6bfc1ec.tar.gz
spack-fe863b68b2c44f8f3152ed40f9f50d11d6bfc1ec.tar.bz2
spack-fe863b68b2c44f8f3152ed40f9f50d11d6bfc1ec.tar.xz
spack-fe863b68b2c44f8f3152ed40f9f50d11d6bfc1ec.zip
biobambam2: Add test method and test scripts. (#21504)
Co-Authored-By: Tamara Dahlgren <dahlgren1@llnl.gov>
-rw-r--r--var/spack/repos/builtin/packages/biobambam2/package.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/biobambam2/package.py b/var/spack/repos/builtin/packages/biobambam2/package.py
index 79b7269384..bafad81657 100644
--- a/var/spack/repos/builtin/packages/biobambam2/package.py
+++ b/var/spack/repos/builtin/packages/biobambam2/package.py
@@ -21,6 +21,26 @@ class Biobambam2(AutotoolsPackage):
depends_on('m4', type='build')
depends_on('libmaus2')
+ test_src_dir = 'test'
+
def configure_args(self):
args = ['--with-libmaus2={0}'.format(self.spec['libmaus2'].prefix)]
return args
+
+ def _fix_shortsort(self):
+ """Fix the testshortsort.sh file copied during installation."""
+ test_dir = join_path(self.install_test_root, self.test_src_dir)
+ filter_file('../src/', '', join_path(test_dir, 'testshortsort.sh'))
+
+ @run_after('install')
+ def cache_test_sources(self):
+ """Copy the test source files after the package is installed to an
+ install test subdirectory for use during `spack test run`."""
+ self.cache_extra_test_sources(self.test_src_dir)
+ self._fix_shortsort()
+
+ def test(self):
+ test_dir = join_path(self.install_test_root, self.test_src_dir)
+ self.run_test('sh', ['testshortsort.sh'],
+ expected='Alignments sorted by coordinate.',
+ work_dir=test_dir)