diff options
author | Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com> | 2021-05-11 10:38:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-11 10:38:40 -0700 |
commit | 00fe243e9c39193c2c392b2d38619358bec4c39a (patch) | |
tree | 0e63312a97d7a909b56b1c62ca28deb948379c09 /var | |
parent | 066d33b4b36a0db087a9143fcc02ba43d1c58e15 (diff) | |
download | spack-00fe243e9c39193c2c392b2d38619358bec4c39a.tar.gz spack-00fe243e9c39193c2c392b2d38619358bec4c39a.tar.bz2 spack-00fe243e9c39193c2c392b2d38619358bec4c39a.tar.xz spack-00fe243e9c39193c2c392b2d38619358bec4c39a.zip |
tests/bugfix: Fix and clean up copied example checks (#23276)
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/openmpi/package.py | 40 |
1 files changed, 30 insertions, 10 deletions
diff --git a/var/spack/repos/builtin/packages/openmpi/package.py b/var/spack/repos/builtin/packages/openmpi/package.py index 8b1ea5dd35..697171a02a 100644 --- a/var/spack/repos/builtin/packages/openmpi/package.py +++ b/var/spack/repos/builtin/packages/openmpi/package.py @@ -949,14 +949,29 @@ class Openmpi(AutotoolsPackage): self.run_test(exe, '--version', expected, installed=True, purpose=purpose, skip_missing=True) + def _test_build_examples(self): + # Build the examples copied during installation and return "status" + reason = 'test: ensuring ability to build the examples' + return self.run_test('make', ['all'], [], + purpose=reason, + work_dir=join_path(self.install_test_root, + self.extra_install_tests)) + + def _test_clean_examples(self): + # Clean up any example build files + reason = 'test: ensuring copied examples cleaned up' + return self.run_test('make', ['clean'], [], + purpose=reason, + work_dir=join_path(self.install_test_root, + self.extra_install_tests)) + def _test_examples(self): - # First build the examples - self.run_test('make', ['all'], [], - purpose='test: ensuring ability to build the examples', - work_dir=join_path(self.install_test_root, - self.extra_install_tests)) + # First ensure can build copied examples + if not self._test_build_examples(): + self._test_clean_examples() + return - # Now run those with known results + # Now run examples with known, simple-to-verify results have_spml = self.spec.satisfies('@2.0.0:2.1.6') hello_world = (['Hello, world', 'I am', '0 of', '1'], 0) @@ -995,10 +1010,15 @@ class Openmpi(AutotoolsPackage): } for exe in checks: - expected = checks[exe] - reason = 'test: checking example {0} output'.format(exe) - self.run_test(exe, [], expected, 0, installed=True, - purpose=reason, skip_missing=True) + expected, status = checks[exe] + reason = 'test: checking {0} example output and status ({1})' \ + .format(exe, status) + self.run_test(exe, [], expected, status, installed=False, + purpose=reason, skip_missing=True, + work_dir=join_path(self.install_test_root, + self.extra_install_tests)) + + self._test_clean_examples() def test(self): """Perform smoke tests on the installed package.""" |