summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2016-07-09 12:10:16 -0700
committerGitHub <noreply@github.com>2016-07-09 12:10:16 -0700
commitb0f4052bd8aee7d77bb6dd8bb022553cd0a4593d (patch)
tree7b39b26cd5b485bf047c17c97c5bc33f8f475003 /lib
parentc086ccdab66be0443706b86f64e046965a76fe2c (diff)
parente482994a1505bf7b8e506872c8ac205fce68b217 (diff)
downloadspack-b0f4052bd8aee7d77bb6dd8bb022553cd0a4593d.tar.gz
spack-b0f4052bd8aee7d77bb6dd8bb022553cd0a4593d.tar.bz2
spack-b0f4052bd8aee7d77bb6dd8bb022553cd0a4593d.tar.xz
spack-b0f4052bd8aee7d77bb6dd8bb022553cd0a4593d.zip
Merge pull request #1169 from davydden/feature/install_argument_tests_petsc_fixes
--run-tests install argument and petsc fixes
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/install.py5
-rw-r--r--lib/spack/spack/package.py10
2 files changed, 14 insertions, 1 deletions
diff --git a/lib/spack/spack/cmd/install.py b/lib/spack/spack/cmd/install.py
index 3133e080d7..4c076322a9 100644
--- a/lib/spack/spack/cmd/install.py
+++ b/lib/spack/spack/cmd/install.py
@@ -58,6 +58,10 @@ def setup_parser(subparser):
help="Install a package *without* cleaning the environment.")
subparser.add_argument(
'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):
@@ -80,6 +84,7 @@ def install(parser, args):
keep_stage=args.keep_stage,
ignore_deps=args.ignore_deps,
make_jobs=args.jobs,
+ run_tests=args.run_tests,
verbose=args.verbose,
fake=args.fake,
dirty=args.dirty,
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py
index 84bd99df54..74008c4dd9 100644
--- a/lib/spack/spack/package.py
+++ b/lib/spack/spack/package.py
@@ -311,6 +311,8 @@ class Package(object):
parallel = True
"""# jobs to use for parallel make. If set, overrides default of ncpus."""
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."""
extendable = False
"""List of prefix-relative file paths (or a single path). If these do
@@ -881,6 +883,7 @@ class Package(object):
skip_patch=False,
verbose=False,
make_jobs=None,
+ run_tests=False,
fake=False,
explicit=False,
dirty=False,
@@ -902,6 +905,7 @@ class Package(object):
verbose -- Display verbose build output (by default, suppresses it)
dirty -- Don't clean the build environment before installing.
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:
raise ValueError("Can only install concrete packages.")
@@ -932,7 +936,11 @@ class Package(object):
fake=fake,
skip_patch=skip_patch,
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.
self.make_jobs = make_jobs