Ensure that tests are optional (#3922)

This commit is contained in:
Adam J. Stewart 2017-04-21 12:15:39 -05:00 committed by GitHub
parent 5250e8ee89
commit 46d0ca9d01
13 changed files with 24 additions and 14 deletions

View file

@ -110,7 +110,8 @@ def install(self, spec, prefix):
make('shared_all')
make("install")
self.install_test()
if self.run_tests:
self.install_test()
@property
def libs(self):

View file

@ -108,7 +108,7 @@ def install(self, spec, prefix):
else:
wantmpi = 'BUILD=NOMPI'
mpif90 = 'MPIF90C='
# Choose BLAS and LAPACK
lapack = ("LAPACKL=%s" %
(spec['lapack'].libs + spec['blas'].libs).ld_flags)
@ -158,8 +158,8 @@ def install(self, spec, prefix):
for filename in fnmatch.filter(filenames, '*~'):
os.remove(os.path.join(dirpath, filename))
@on_package_attributes(run_tests=True)
@run_after('install')
@on_package_attributes(run_tests=True)
def check_install(self):
prefix = self.prefix
spec = self.spec

View file

@ -138,7 +138,8 @@ def build(self, spec, prefix):
with working_dir('quad'):
make()
def check(self, spec, prefix):
def check(self):
spec = self.spec
if '+double' in spec:
with working_dir('double'):
make("check")

View file

@ -111,7 +111,8 @@ def install(self, spec, prefix):
"-L%s" % spec["hdf5"].prefix.lib, "-lhdf5")
_install_shlib("libblosc_plugin", ".libs", prefix.lib)
self.check_install(spec)
if self.run_tests:
self.check_install(spec)
def check_install(self, spec):
"Build and run a small program to test the installed HDF5 Blosc plugin"

View file

@ -79,11 +79,11 @@ class Hdf5(AutotoolsPackage):
@property
def libs(self):
"""Hdf5 can be queried for the following parameters:
- "hl": high-level interface
- "cxx": C++ APIs
- "fortran": fortran APIs
:return: list of matching libraries
"""
query_parameters = self.spec.last_query.extra_parameters
@ -228,6 +228,7 @@ def patch_postdeps(self):
'libtool')
@run_after('install')
@on_package_attributes(run_tests=True)
def check_install(self):
# Build and run a small program to test the installed HDF5 library
spec = self.spec

View file

@ -63,7 +63,8 @@ def build(self, spec, prefix):
with working_dir('long-double'):
make()
def check(self, spec, prefix):
def check(self):
spec = self.spec
if '+double' in spec['fftw']:
with working_dir('double'):
make("check")

View file

@ -123,8 +123,8 @@ def build_targets(self):
return self.make_defs + targets
@on_package_attributes(run_tests=True)
@run_after('build')
@on_package_attributes(run_tests=True)
def check_build(self):
make('tests', *self.make_defs)
@ -136,8 +136,8 @@ def install_targets(self):
]
return make_args + self.make_defs
@on_package_attributes(run_tests=True)
@run_after('install')
@on_package_attributes(run_tests=True)
def check_install(self):
spec = self.spec
# Openblas may pass its own test but still fail to compile Lapack

View file

@ -47,7 +47,7 @@ class Perl(Package): # Perl doesn't use Autotools, it should subclass Package
# Maintenance releases (recommended)
version('5.24.1', '765ef511b5b87a164e2531403ee16b3c', preferred=True)
version('5.22.3', 'aa4f236dc2fc6f88b871436b8d0fda95')
# Misc releases that people need
version('5.22.2', '5767e2a10dd62a46d7b57f74a90d952b')
@ -98,6 +98,7 @@ def configure(self, spec, prefix):
def build(self, spec, prefix):
make()
@run_after('build')
@on_package_attributes(run_tests=True)
def test(self):
make('test')

View file

@ -67,7 +67,8 @@ def build(self, spec, prefix):
with working_dir('long-double'):
make()
def check(self, spec, prefix):
def check(self):
spec = self.spec
if '+double' in spec['fftw']:
with working_dir('double'):
make("check")

View file

@ -137,8 +137,8 @@ def setup_environment(self, spack_env, run_env):
run_env.set('CLIK_DATA', join_path(prefix, 'share', 'clik'))
run_env.set('CLIK_PLUGIN', 'rel2015')
@on_package_attributes(run_tests=True)
@run_after('install')
@on_package_attributes(run_tests=True)
def check_install(self):
prefix = self.prefix
clik_example_C = Executable(join_path(prefix.bin, 'clik_example_C'))

View file

@ -64,7 +64,8 @@ def build(self, spec, prefix):
with working_dir('long-double'):
make()
def check(self, spec, prefix):
def check(self):
spec = self.spec
if '+double' in spec['fftw']:
with working_dir('double'):
make("check")

View file

@ -95,6 +95,7 @@ def symlink_opencl(self):
os.symlink("OpenCL", join_path(self.prefix.include, "CL"))
@run_after('install')
@on_package_attributes(run_tests=True)
def check_install(self):
# Build and run a small program to test the installed OpenCL library
spec = self.spec

View file

@ -78,6 +78,7 @@ def prep_yt(self):
rockstar_cfg.write(self.spec['rockstar'].prefix)
@run_after('install')
@on_package_attributes(run_tests=True)
def check_install(self):
# The Python interpreter path can be too long for this
# yt = Executable(join_path(prefix.bin, "yt"))