Originally I enforced specifying 1 top-level package with the test-install
command by having it consume exactly 1 positional argument (i.e. by removing "nargs=argparse.REMAINDER") but this does not work when configuring dependencies of a top-level package (which show up as additional positional args). Instead now there is an explicit check to ensure there is only 1 top-level package.
This commit is contained in:
parent
e451421db3
commit
82ed1bc343
@ -49,7 +49,7 @@ def setup_parser(subparser):
|
|||||||
'-o', '--output', action='store', help="test output goes in this file")
|
'-o', '--output', action='store', help="test output goes in this file")
|
||||||
|
|
||||||
subparser.add_argument(
|
subparser.add_argument(
|
||||||
'package', help="spec of package to install")
|
'package', nargs=argparse.REMAINDER, help="spec of package to install")
|
||||||
|
|
||||||
|
|
||||||
class JunitResultFormat(object):
|
class JunitResultFormat(object):
|
||||||
@ -120,11 +120,10 @@ def test_install(parser, args):
|
|||||||
|
|
||||||
if args.no_checksum:
|
if args.no_checksum:
|
||||||
spack.do_checksum = False # TODO: remove this global.
|
spack.do_checksum = False # TODO: remove this global.
|
||||||
|
|
||||||
# TODO: should a single argument be wrapped in a list?
|
|
||||||
specs = spack.cmd.parse_specs(args.package, concretize=True)
|
|
||||||
|
|
||||||
# There is 1 top-level package
|
specs = spack.cmd.parse_specs(args.package, concretize=True)
|
||||||
|
if len(specs) > 1:
|
||||||
|
tty.die("Only 1 top-level package can be specified")
|
||||||
topSpec = iter(specs).next()
|
topSpec = iter(specs).next()
|
||||||
|
|
||||||
newInstalls = set()
|
newInstalls = set()
|
||||||
|
Loading…
Reference in New Issue
Block a user