Ensure that tests are optional (#3922)
This commit is contained in:
parent
5250e8ee89
commit
46d0ca9d01
@ -110,6 +110,7 @@ def install(self, spec, prefix):
|
||||
make('shared_all')
|
||||
|
||||
make("install")
|
||||
if self.run_tests:
|
||||
self.install_test()
|
||||
|
||||
@property
|
||||
|
@ -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
|
||||
|
@ -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")
|
||||
|
@ -111,6 +111,7 @@ def install(self, spec, prefix):
|
||||
"-L%s" % spec["hdf5"].prefix.lib, "-lhdf5")
|
||||
_install_shlib("libblosc_plugin", ".libs", prefix.lib)
|
||||
|
||||
if self.run_tests:
|
||||
self.check_install(spec)
|
||||
|
||||
def check_install(self, spec):
|
||||
|
@ -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
|
||||
|
@ -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")
|
||||
|
@ -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
|
||||
|
@ -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')
|
||||
|
@ -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")
|
||||
|
@ -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'))
|
||||
|
@ -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")
|
||||
|
@ -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
|
||||
|
@ -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"))
|
||||
|
Loading…
Reference in New Issue
Block a user