summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/package.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py
index 91e6b74dbd..75a708de9c 100644
--- a/lib/spack/spack/package.py
+++ b/lib/spack/spack/package.py
@@ -1733,6 +1733,16 @@ class AutotoolsPackage(PackageBase):
def install(self, spec, prefix):
inspect.getmodule(self).make('install')
+ @PackageBase.sanity_check('build')
+ @PackageBase.on_package_attributes(run_tests=True)
+ def _run_default_function(self):
+ 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
+
# This will be used as a registration decorator in user
# packages, if need be
PackageBase.sanity_check('install')(PackageBase.sanity_check_prefix)
@@ -1792,6 +1802,16 @@ class CMakePackage(PackageBase):
with working_dir(self.wdir()):
inspect.getmodule(self).make('install')
+ @PackageBase.sanity_check('build')
+ @PackageBase.on_package_attributes(run_tests=True)
+ def _run_default_function(self):
+ 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
+
PackageBase.sanity_check('install')(PackageBase.sanity_check_prefix)