summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorSergei Shudler <sergshu@gmail.com>2021-06-18 10:50:18 -0700
committerGitHub <noreply@github.com>2021-06-18 10:50:18 -0700
commit4690fdc0813328431e7573e835445c917bfa2e89 (patch)
tree1b5efe1880c97abfb60d2e07d1035de224a3fbfe /var
parent1b368e433c894c72dc7bc2d853afcd44d18cb248 (diff)
downloadspack-4690fdc0813328431e7573e835445c917bfa2e89.tar.gz
spack-4690fdc0813328431e7573e835445c917bfa2e89.tar.bz2
spack-4690fdc0813328431e7573e835445c917bfa2e89.tar.xz
spack-4690fdc0813328431e7573e835445c917bfa2e89.zip
SLATE: Add e4s testsuite-inspired smoke test (#23376)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/slate/package.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/slate/package.py b/var/spack/repos/builtin/packages/slate/package.py
index 61490eeb42..08378ff7a9 100644
--- a/var/spack/repos/builtin/packages/slate/package.py
+++ b/var/spack/repos/builtin/packages/slate/package.py
@@ -20,6 +20,8 @@ class Slate(CMakePackage, CudaPackage, ROCmPackage):
url = 'https://bitbucket.org/icl/slate/downloads/slate-2020.10.00.tar.gz'
maintainers = ['G-Ragghianti', 'mgates3']
+ test_requires_compiler = True
+
version('master', branch='master')
version('2021.05.02', sha256='29667a9e869e41fbc22af1ae2bcd425d79b4094bbb3f21c411888e7adc5d12e3')
version('2021.05.01', sha256='d9db2595f305eb5b1b49a77cc8e8c8e43c3faab94ed910d8387c221183654218')
@@ -68,3 +70,29 @@ class Slate(CMakePackage, CudaPackage, ROCmPackage):
'-Duse_mpi=%s' % ('+mpi' in spec),
'-DSCALAPACK_LIBRARIES=%s' % spec['scalapack'].libs.joined(';')
]
+
+ examples_src_dir = 'examples'
+
+ @run_after('install')
+ def cache_test_sources(self):
+ """Copy the example source files after the package is installed to an
+ install test subdirectory for use during `spack test run`."""
+ if self.spec.satisfies('@master'):
+ self.cache_extra_test_sources([self.examples_src_dir])
+
+ def test(self):
+ if not self.spec.satisfies('@master') or '+mpi' not in self.spec:
+ print('Skipping: stand-alone tests only run on master with +mpi')
+ return
+
+ test_dir = join_path(self.install_test_root, self.examples_src_dir)
+ test_bld_dir = join_path(test_dir, 'build')
+ with working_dir(test_bld_dir, create=True):
+ cmake('..')
+ make()
+ test_args = ['-n', '4', './ex05_blas']
+ mpiexe_f = which('srun', 'mpirun', 'mpiexec')
+ if mpiexe_f:
+ self.run_test(mpiexe_f.command, test_args,
+ purpose='SLATE smoke test')
+ make('clean')