add --run-tests argument for install()
This commit is contained in:
parent
9fb8030370
commit
081918d71a
@ -55,6 +55,10 @@ def setup_parser(subparser):
|
|||||||
help="Fake install. Just remove the prefix and touch a fake file in it.")
|
help="Fake install. Just remove the prefix and touch a fake file in it.")
|
||||||
subparser.add_argument(
|
subparser.add_argument(
|
||||||
'packages', nargs=argparse.REMAINDER, help="specs of packages to install")
|
'packages', nargs=argparse.REMAINDER, help="specs of packages to install")
|
||||||
|
subparser.add_argument(
|
||||||
|
'--run-tests', action='store_true', dest='run_tests',
|
||||||
|
help="Run tests during installation of a package.")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def install(parser, args):
|
def install(parser, args):
|
||||||
@ -77,6 +81,7 @@ def install(parser, args):
|
|||||||
keep_stage=args.keep_stage,
|
keep_stage=args.keep_stage,
|
||||||
ignore_deps=args.ignore_deps,
|
ignore_deps=args.ignore_deps,
|
||||||
make_jobs=args.jobs,
|
make_jobs=args.jobs,
|
||||||
|
run_tests=args.run_tests,
|
||||||
verbose=args.verbose,
|
verbose=args.verbose,
|
||||||
fake=args.fake,
|
fake=args.fake,
|
||||||
explicit=True)
|
explicit=True)
|
||||||
|
@ -311,6 +311,8 @@ class SomePackage(Package):
|
|||||||
parallel = True
|
parallel = True
|
||||||
"""# jobs to use for parallel make. If set, overrides default of ncpus."""
|
"""# jobs to use for parallel make. If set, overrides default of ncpus."""
|
||||||
make_jobs = None
|
make_jobs = None
|
||||||
|
"""By default do not run tests within package's install()"""
|
||||||
|
run_tests = False
|
||||||
"""Most packages are NOT extendable. Set to True if you want extensions."""
|
"""Most packages are NOT extendable. Set to True if you want extensions."""
|
||||||
extendable = False
|
extendable = False
|
||||||
"""List of prefix-relative file paths (or a single path). If these do
|
"""List of prefix-relative file paths (or a single path). If these do
|
||||||
@ -881,6 +883,7 @@ def do_install(self,
|
|||||||
skip_patch=False,
|
skip_patch=False,
|
||||||
verbose=False,
|
verbose=False,
|
||||||
make_jobs=None,
|
make_jobs=None,
|
||||||
|
run_tests=False,
|
||||||
fake=False,
|
fake=False,
|
||||||
explicit=False,
|
explicit=False,
|
||||||
install_phases = install_phases):
|
install_phases = install_phases):
|
||||||
@ -900,6 +903,7 @@ def do_install(self,
|
|||||||
skip_patch -- Skip patch stage of build if True.
|
skip_patch -- Skip patch stage of build if True.
|
||||||
verbose -- Display verbose build output (by default, suppresses it)
|
verbose -- Display verbose build output (by default, suppresses it)
|
||||||
make_jobs -- Number of make jobs to use for install. Default is ncpus
|
make_jobs -- Number of make jobs to use for install. Default is ncpus
|
||||||
|
run_tests -- Runn tests within the package's install()
|
||||||
"""
|
"""
|
||||||
if not self.spec.concrete:
|
if not self.spec.concrete:
|
||||||
raise ValueError("Can only install concrete packages.")
|
raise ValueError("Can only install concrete packages.")
|
||||||
@ -930,7 +934,11 @@ def do_install(self,
|
|||||||
fake=fake,
|
fake=fake,
|
||||||
skip_patch=skip_patch,
|
skip_patch=skip_patch,
|
||||||
verbose=verbose,
|
verbose=verbose,
|
||||||
make_jobs=make_jobs)
|
make_jobs=make_jobs,
|
||||||
|
run_tests=run_tests)
|
||||||
|
|
||||||
|
# Set run_tests flag before starting build.
|
||||||
|
self.run_tests = run_tests
|
||||||
|
|
||||||
# Set parallelism before starting build.
|
# Set parallelism before starting build.
|
||||||
self.make_jobs = make_jobs
|
self.make_jobs = make_jobs
|
||||||
|
Loading…
Reference in New Issue
Block a user