summaryrefslogtreecommitdiff
path: root/lib/spack/spack/build_systems/autotools.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/spack/spack/build_systems/autotools.py')
-rw-r--r--lib/spack/spack/build_systems/autotools.py24
1 files changed, 6 insertions, 18 deletions
diff --git a/lib/spack/spack/build_systems/autotools.py b/lib/spack/spack/build_systems/autotools.py
index 37c780b360..d08ea02428 100644
--- a/lib/spack/spack/build_systems/autotools.py
+++ b/lib/spack/spack/build_systems/autotools.py
@@ -30,9 +30,8 @@ import shutil
from subprocess import PIPE
from subprocess import check_call
-import llnl.util.tty as tty
from llnl.util.filesystem import working_dir
-from spack.package import PackageBase
+from spack.package import PackageBase, run_after
class AutotoolsPackage(PackageBase):
@@ -80,6 +79,8 @@ class AutotoolsPackage(PackageBase):
#: phase
install_targets = ['install']
+ build_time_test_callbacks = ['check']
+
def _do_patch_config_guess(self):
"""Some packages ship with an older config.guess and need to have
this updated when installed on a newer architecture."""
@@ -168,7 +169,7 @@ class AutotoolsPackage(PackageBase):
"""Not needed usually, configure should be already there"""
pass
- @PackageBase.sanity_check('autoreconf')
+ @run_after('autoreconf')
def is_configure_or_die(self):
"""Checks the presence of a `configure` file after the
:py:meth:`.autoreconf` phase.
@@ -211,20 +212,7 @@ class AutotoolsPackage(PackageBase):
with working_dir(self.build_directory()):
inspect.getmodule(self).make(*self.install_targets)
- @PackageBase.sanity_check('build')
- @PackageBase.on_package_attributes(run_tests=True)
- def _run_default_function(self):
- """This function is run after build if ``self.run_tests == True``
-
- It will search for a method named :py:meth:`.check` and run it. A
- sensible default is provided in the base class.
- """
- try:
- fn = getattr(self, 'check')
- tty.msg('Trying default sanity checks [check]')
- fn()
- except AttributeError:
- tty.msg('Skipping default sanity checks [method `check` not implemented]') # NOQA: ignore=E501
+ run_after('build')(PackageBase._run_default_build_time_test_callbacks)
def check(self):
"""Searches the Makefile for targets ``test`` and ``check``
@@ -235,4 +223,4 @@ class AutotoolsPackage(PackageBase):
self._if_make_target_execute('check')
# Check that self.prefix is there after installation
- PackageBase.sanity_check('install')(PackageBase.sanity_check_prefix)
+ run_after('install')(PackageBase.sanity_check_prefix)