summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--var/spack/repos/builtin/packages/tau/package.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/tau/package.py b/var/spack/repos/builtin/packages/tau/package.py
index 486b6734c9..ae20635829 100644
--- a/var/spack/repos/builtin/packages/tau/package.py
+++ b/var/spack/repos/builtin/packages/tau/package.py
@@ -331,3 +331,36 @@ class Tau(Package):
# in the latter case.
if files:
env.set('TAU_MAKEFILE', files[0])
+
+ matmult_test = join_path('examples', 'mm')
+
+ @run_after('install')
+ def setup_build_tests(self):
+ """Copy the build test files after the package is installed to an
+ install test subdirectory for use during `spack test run`."""
+ self.cache_extra_test_sources(self.matmult_test)
+
+ def _run_matmult_test(self):
+ mm_dir = join_path(self.test_suite.current_test_cache_dir, self.matmult_test)
+ self.run_test('make', ['all'], [], 0, False,
+ 'Instrument and build matrix multiplication test code',
+ False, mm_dir)
+ test_exe = 'matmult'
+ if '+mpi' in self.spec:
+ test_args = ['-n', '4', test_exe]
+ mpiexe_list = ['mpirun', 'mpiexec', 'srun']
+ for mpiexe in mpiexe_list:
+ if which(mpiexe) is not None:
+ self.run_test(mpiexe, test_args, [], 0, False,
+ 'Run matmult test with mpi', False, mm_dir)
+ break
+ else:
+ self.run_test(test_exe, [], [], 0, False,
+ 'Run sequential matmult test', False, mm_dir)
+ self.run_test('pprof', [], [], 0, False,
+ 'Run pprof profile analysis tool on profile output',
+ False, mm_dir)
+
+ def test(self):
+ # Run mm test program pulled from the build
+ self._run_matmult_test()