Add an installcheck phase to MakefilePackage (#4476)

* Add an installcheck phase to MakefilePackage

* Minor changes to ESMF
This commit is contained in:
Adam J. Stewart 2017-06-12 09:47:46 -05:00 committed by GitHub
parent ab9155eb37
commit 0de653ff01
2 changed files with 21 additions and 17 deletions

View File

@ -75,6 +75,9 @@ class MakefilePackage(PackageBase):
#: Callback names for build-time test #: Callback names for build-time test
build_time_test_callbacks = ['check'] build_time_test_callbacks = ['check']
#: Callback names for install-time test
install_time_test_callbacks = ['installcheck']
@property @property
def build_directory(self): def build_directory(self):
"""Returns the directory containing the main Makefile """Returns the directory containing the main Makefile
@ -113,5 +116,14 @@ def check(self):
self._if_make_target_execute('test') self._if_make_target_execute('test')
self._if_make_target_execute('check') self._if_make_target_execute('check')
run_after('install')(PackageBase._run_default_install_time_test_callbacks)
def installcheck(self):
"""Searches the Makefile for an ``installcheck`` target
and runs it if found.
"""
with working_dir(self.build_directory):
self._if_make_target_execute('installcheck')
# Check that self.prefix is there after installation # Check that self.prefix is there after installation
run_after('install')(PackageBase.sanity_check_prefix) run_after('install')(PackageBase.sanity_check_prefix)

View File

@ -26,7 +26,7 @@
import os import os
class Esmf(Package): class Esmf(MakefilePackage):
"""The Earth System Modeling Framework (ESMF) is high-performance, flexible """The Earth System Modeling Framework (ESMF) is high-performance, flexible
software infrastructure for building and coupling weather, climate, and software infrastructure for building and coupling weather, climate, and
related Earth science applications. The ESMF defines an architecture for related Earth science applications. The ESMF defines an architecture for
@ -47,25 +47,28 @@ class Esmf(Package):
variant('debug', default=False, description='Make a debuggable version of the library') variant('debug', default=False, description='Make a debuggable version of the library')
# Required dependencies # Required dependencies
depends_on('mpi', when='+mpi')
depends_on('zlib') depends_on('zlib')
depends_on('libxml2') depends_on('libxml2')
# depends_on('perl', type='test') # TODO: Add a test deptype
# Optional dependencies # Optional dependencies
depends_on('mpi', when='+mpi')
depends_on('lapack@3:', when='+lapack') depends_on('lapack@3:', when='+lapack')
depends_on('netcdf@3.6:', when='+netcdf') depends_on('netcdf@3.6:', when='+netcdf')
depends_on('netcdf-fortran@3.6:', when='+netcdf') depends_on('netcdf-fortran@3.6:', when='+netcdf')
depends_on('parallel-netcdf@1.2.0:', when='+pnetcdf') depends_on('parallel-netcdf@1.2.0:', when='+pnetcdf')
depends_on('xerces-c@3.1.0:', when='+xerces') depends_on('xerces-c@3.1.0:', when='+xerces')
# Testing dependencies
# depends_on('perl', type='test') # TODO: Add a test deptype
# NOTE: ESMF cannot be installed with GCC 6. It uses constructs that # NOTE: ESMF cannot be installed with GCC 6. It uses constructs that
# are no longer valid in GCC 6. GCC 4 is recommended for installation. # are no longer valid in GCC 6. GCC 4 is recommended for installation.
conflicts('%gcc@6:')
def url_for_version(self, version): def url_for_version(self, version):
return "http://www.earthsystemmodeling.org/esmf_releases/non_public/ESMF_{0}/esmf_{0}_src.tar.gz".format(version.underscored) return "http://www.earthsystemmodeling.org/esmf_releases/non_public/ESMF_{0}/esmf_{0}_src.tar.gz".format(version.underscored)
def install(self, spec, prefix): def edit(self, spec, prefix):
# Installation instructions can be found at: # Installation instructions can be found at:
# http://www.earthsystemmodeling.org/esmf_releases/last_built/ESMF_usrdoc/node9.html # http://www.earthsystemmodeling.org/esmf_releases/last_built/ESMF_usrdoc/node9.html
@ -238,16 +241,5 @@ def install(self, spec, prefix):
# ESMF_XERCES_INCLUDE # ESMF_XERCES_INCLUDE
# ESMF_XERCES_LIBPATH # ESMF_XERCES_LIBPATH
################ def check(self):
# Installation # make('check', parallel=False)
################
make()
if self.run_tests:
make('check', parallel=False)
make('install')
if self.run_tests:
make('installcheck')