Add tests to MakefilePackage (#4039)
This commit is contained in:
parent
7f9acfa3b2
commit
4bfba146d5
@ -72,6 +72,9 @@ class MakefilePackage(PackageBase):
|
|||||||
#: phase
|
#: phase
|
||||||
install_targets = ['install']
|
install_targets = ['install']
|
||||||
|
|
||||||
|
#: Callback names for build-time test
|
||||||
|
build_time_test_callbacks = ['check']
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def build_directory(self):
|
def build_directory(self):
|
||||||
"""Returns the directory containing the main Makefile
|
"""Returns the directory containing the main Makefile
|
||||||
@ -100,5 +103,15 @@ def install(self, spec, prefix):
|
|||||||
with working_dir(self.build_directory):
|
with working_dir(self.build_directory):
|
||||||
inspect.getmodule(self).make(*self.install_targets)
|
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
|
# Check that self.prefix is there after installation
|
||||||
run_after('install')(PackageBase.sanity_check_prefix)
|
run_after('install')(PackageBase.sanity_check_prefix)
|
||||||
|
Loading…
Reference in New Issue
Block a user