diff options
author | Richarda Butler <39577672+RikkiButler20@users.noreply.github.com> | 2021-09-27 11:36:53 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-27 11:36:53 -0700 |
commit | c68536e9d33389051fbfb484ff25701f1b68b666 (patch) | |
tree | bf16915def2d62bf210284cf4aea0bce1c7a872d /var | |
parent | c07af15946edd2bf9d04c3a6d9109606e63b82b4 (diff) | |
download | spack-c68536e9d33389051fbfb484ff25701f1b68b666.tar.gz spack-c68536e9d33389051fbfb484ff25701f1b68b666.tar.bz2 spack-c68536e9d33389051fbfb484ff25701f1b68b666.tar.xz spack-c68536e9d33389051fbfb484ff25701f1b68b666.zip |
MPICH: Add E4S testsuite stand alone test (#25634)
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/mpich/package.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/mpich/package.py b/var/spack/repos/builtin/packages/mpich/package.py index f8ee57aa0b..bbf2681b27 100644 --- a/var/spack/repos/builtin/packages/mpich/package.py +++ b/var/spack/repos/builtin/packages/mpich/package.py @@ -476,3 +476,35 @@ spack package at this time.''', config_args.append('--with-argobots=' + spec['argobots'].prefix) return config_args + + @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`.""" + self.cache_extra_test_sources(['examples', join_path('test', 'mpi')]) + + def run_mpich_test(self, example_dir, exe): + """Run stand alone tests""" + + test_dir = join_path(self.test_suite.current_test_cache_dir, + example_dir) + exe_source = join_path(test_dir, '{0}.c'.format(exe)) + + if not os.path.isfile(exe_source): + print('Skipping {0} test'.format(exe)) + return + + self.run_test(self.prefix.bin.mpicc, + options=[exe_source, '-Wall', '-g', '-o', exe], + purpose='test: generate {0} file'.format(exe), + work_dir=test_dir) + + self.run_test(exe, + purpose='test: run {0} example'.format(exe), + work_dir=test_dir) + + def test(self): + self.run_mpich_test(join_path('test', 'mpi', 'init'), 'finalized') + self.run_mpich_test(join_path('test', 'mpi', 'basic'), 'sendrecv') + self.run_mpich_test(join_path('test', 'mpi', 'perf'), 'manyrma') + self.run_mpich_test('examples', 'cpi') |