Skip to content
Snippets Groups Projects

Change NEST tests from build to install phase

Compare and
3 files
+ 122
10
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 46
10
@@ -61,6 +61,8 @@ class Nest(CMakePackage):
description="Enable GNU Scientific Library")
variant('shared', default=True,
description="Build shared libraries")
variant('testsuite', default=False,
description="Run extended testsuite with full number of unit- and integration tests")
variant('boost', default=True,
description="Enable optimizations provided via Boost library algorithms and containers")
# TODO add variants for neurosim and music when these are in spack
@@ -77,20 +79,35 @@ class Nest(CMakePackage):
depends_on('python@2.6:', when='@2.16:+python', type=('build', 'run'))
depends_on('python@3.8:', when='@3:', type=('build', 'run'))
depends_on('py-numpy@:1.16.99', when='@:2.14.99+python', type=('build', 'run'))
depends_on('py-numpy', when='+python', type=('build', 'run'))
depends_on('py-numpy', when='+python', type=('build', 'run', 'test'))
depends_on('py-pandas', when='@3:', type=('test'))
depends_on('py-cython@0.19.2:', when='+python', type='build')
depends_on('py-nose', when='+python', type='test')
depends_on('py-setuptools', when='+python', type='build')
depends_on('boost', when="@2.16:+boost", type='build')
depends_on('py-setuptools@:44.99.99', when='@:2.15.99+python', type='build')
depends_on('mpi', when='+mpi')
depends_on('doxygen', type='build')
depends_on('gsl', when='+gsl')
depends_on('readline')
depends_on('ncurses')
depends_on('libtool')
depends_on('pkgconfig', type='build')
depends_on('py-nose', when='@:2.99.99+python+testsuite', type='test')
depends_on('py-pytest', when='@3.0:+testsuite', type='test')
depends_on('py-pytest-xdist', when='@3.0:+testsuite', type='test')
depends_on('py-pytest-timeout', when='@3.0:+testsuite', type='test')
depends_on('py-junitparser@2:', when='+testsuite', type='test')
depends_on('py-terminaltables', when='@3:+testsuite', type='test')
depends_on('py-pycodestyle', when='@3:+testsuite', type='test')
depends_on('cppcheck', when='+testsuite', type='test')
# for `clang-format`
depends_on('py-clang-format@3.6', when='@:3.1.99+testsuite', type='test')
depends_on('py-clang-format@9', when='@3.2:3.3.99+testsuite', type='test')
depends_on('py-clang-format@13', when='@3.4:+testsuite', type='test')
depends_on('mpi', when='+mpi')
depends_on('py-mpi4py', when='+python+mpi', type=('run', 'test'))
depends_on('doxygen', type='build')
depends_on('gsl', when='+gsl')
depends_on('readline', type=('build', 'run', 'test'))
depends_on('ncurses', type=('build', 'run', 'test'))
depends_on('libtool', type=('build', 'run', 'test'))
depends_on('pkgconfig', type='build')
extends('python', when='+python')
@@ -180,12 +197,31 @@ class Nest(CMakePackage):
@run_after('install')
@on_package_attributes(run_tests=True)
def installcheck(self):
make("installcheck")
if self.spec.variants['testsuite'].value:
print('''
##########################################
###
### RUNNING MAKE INSTALLCHECK
###
##########################################
''')
with working_dir(self.build_directory):
make("installcheck")
def setup_run_environment(self, env):
pass
@run_after('install')
@on_package_attributes(run_tests=True)
def install_test(self):
# test inspired by py-numpy spack package
with working_dir('spack-test', create=True):
python('-c', 'from pprint import pprint; import nest; pprint(nest.get())')
@when('@2.11.0:')
@run_after('build')
@on_package_attributes(run_tests=True)
def check(self):
# 'make test' currently does not run any useful tests, as the focus is on 'make installcheck'.
# So we override this to no-op and use a post-install method instead (see above).
pass