|
30 | 30 | from subprocess import PIPE |
31 | 31 | from subprocess import check_call |
32 | 32 |
|
33 | | -import llnl.util.tty as tty |
34 | 33 | from llnl.util.filesystem import working_dir |
35 | | -from spack.package import PackageBase, run_after, on_package_attributes |
| 34 | +from spack.package import PackageBase, run_after |
36 | 35 |
|
37 | 36 |
|
38 | 37 | class AutotoolsPackage(PackageBase): |
@@ -60,6 +59,8 @@ class AutotoolsPackage(PackageBase): |
60 | 59 | build_targets = [] |
61 | 60 | install_targets = ['install'] |
62 | 61 |
|
| 62 | + build_time_test_callbacks = ['check'] |
| 63 | + |
63 | 64 | def do_patch_config_guess(self): |
64 | 65 | """Some packages ship with an older config.guess and need to have |
65 | 66 | this updated when installed on a newer architecture.""" |
@@ -176,20 +177,7 @@ def install(self, spec, prefix): |
176 | 177 | with working_dir(self.build_directory()): |
177 | 178 | inspect.getmodule(self).make(*self.install_targets) |
178 | 179 |
|
179 | | - @run_after('build') |
180 | | - @on_package_attributes(run_tests=True) |
181 | | - def _run_default_function(self): |
182 | | - """This function is run after build if ``self.run_tests == True`` |
183 | | -
|
184 | | - It will search for a method named ``check`` and run it. A sensible |
185 | | - default is provided in the base class. |
186 | | - """ |
187 | | - try: |
188 | | - fn = getattr(self, 'check') |
189 | | - tty.msg('Trying default sanity checks [check]') |
190 | | - fn() |
191 | | - except AttributeError: |
192 | | - tty.msg('Skipping default sanity checks [method `check` not implemented]') # NOQA: ignore=E501 |
| 180 | + run_after('build')(PackageBase._run_default_build_time_test_callbacks) |
193 | 181 |
|
194 | 182 | def check(self): |
195 | 183 | """Default test: search the Makefile for targets ``test`` and ``check`` |
|
0 commit comments