summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam J. Stewart <ajstewart426@gmail.com>2017-04-28 14:55:28 -0500
committerGitHub <noreply@github.com>2017-04-28 14:55:28 -0500
commit4bfba146d5d6285e66d9f26d69e2dbdbb0573d3b (patch)
treead9eed571d450ca90f08c2fa5c2ac6e6f2d86744
parent7f9acfa3b28d9a0acaada37ba61090a6b34bf879 (diff)
downloadspack-4bfba146d5d6285e66d9f26d69e2dbdbb0573d3b.tar.gz
spack-4bfba146d5d6285e66d9f26d69e2dbdbb0573d3b.tar.bz2
spack-4bfba146d5d6285e66d9f26d69e2dbdbb0573d3b.tar.xz
spack-4bfba146d5d6285e66d9f26d69e2dbdbb0573d3b.zip
Add tests to MakefilePackage (#4039)
-rw-r--r--lib/spack/spack/build_systems/makefile.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/spack/spack/build_systems/makefile.py b/lib/spack/spack/build_systems/makefile.py
index 7274384478..a014ed7c15 100644
--- a/lib/spack/spack/build_systems/makefile.py
+++ b/lib/spack/spack/build_systems/makefile.py
@@ -72,6 +72,9 @@ class MakefilePackage(PackageBase):
#: phase
install_targets = ['install']
+ #: Callback names for build-time test
+ build_time_test_callbacks = ['check']
+
@property
def build_directory(self):
"""Returns the directory containing the main Makefile
@@ -100,5 +103,15 @@ class MakefilePackage(PackageBase):
with working_dir(self.build_directory):
inspect.getmodule(self).make(*self.install_targets)
+ run_after('build')(PackageBase._run_default_build_time_test_callbacks)
+
+ def check(self):
+ """Searches the Makefile for targets ``test`` and ``check``
+ and runs them if found.
+ """
+ with working_dir(self.build_directory):
+ self._if_make_target_execute('test')
+ self._if_make_target_execute('check')
+
# Check that self.prefix is there after installation
run_after('install')(PackageBase.sanity_check_prefix)