build systems: simpler, clearer decorators: run_after, run_before (#2860)

* PackageMeta: `run_before` is an alias of `precondition`, `run_after` an alias of `sanity_check`

* PackageMeta: removed `precondition` and `sanity_check`

* PackageMeta: decorators are now free-standing

* package: modified/added docstrings. Fixed the semantics of `on_package_attributes`.

* package: added unit test assertion as side effects of install

* build_systems: factored build-time test running into base class

* r: updated decorators in package.py

* docs: updated decorator names
This commit is contained in:
Massimiliano Culpo
2017-01-25 16:57:01 +01:00
committed by Todd Gamblin
parent 90d47a3ead
commit fc866ae0fe
21 changed files with 174 additions and 135 deletions

View File

@@ -70,7 +70,7 @@ class Hdf5(AutotoolsPackage):
depends_on('szip', when='+szip')
depends_on('zlib@1.1.2:')
@AutotoolsPackage.precondition('configure')
@run_before('configure')
def validate(self):
"""
Checks if incompatible variants have been activated at the same time
@@ -170,7 +170,7 @@ def configure(self, spec, prefix):
arg for arg in m.group(1).split(' ') if arg != '-l'),
'libtool')
@AutotoolsPackage.sanity_check('install')
@run_after('install')
def check_install(self):
# Build and run a small program to test the installed HDF5 library
spec = self.spec