Build sets can optional keep going on failure to support tool build testing.

The --keep-going option lets a build set continue if it fails. The keep
going is only at the build set level and not at the package level.
This commit is contained in:
Chris Johns 2013-02-21 10:17:24 +11:00
parent 1b7e392fa1
commit 729f0bb61f

View File

@ -225,25 +225,31 @@ class buildset:
try: try:
builds = [] builds = []
for s in range(0, len(configs)): for s in range(0, len(configs)):
if configs[s].endswith('.bset'): try:
bs = buildset(configs[s], if configs[s].endswith('.bset'):
_configs = self.configs, bs = buildset(configs[s],
_defaults = self.defaults, _configs = self.configs,
opts = self.opts) _defaults = self.defaults,
bs.build() opts = self.opts)
del bs bs.build()
elif configs[s].endswith('.cfg'): del bs
b = build.build(configs[s], _defaults = self.defaults, opts = self.opts) elif configs[s].endswith('.cfg'):
if s == 0: b = build.build(configs[s], _defaults = self.defaults, opts = self.opts)
tmproot = self.first_package(b) if s == 0:
b.make() tmproot = self.first_package(b)
self.every_package(b, tmproot) b.make()
if s == len(configs) - 1: self.every_package(b, tmproot)
self.last_package(b, tmproot) if s == len(configs) - 1:
builds += [b] self.last_package(b, tmproot)
else: builds += [b]
raise error.general('invalid config type: %s' % (configs[s])) else:
if not self.opts.no_clean(): raise error.general('invalid config type: %s' % (configs[s]))
except error.general, gerr:
if self.opts.get_arg('--keep-going'):
print gerr
else:
raise
if not self.opts.no_clean() or self.opts.get_arg('--keep-going'):
for b in builds: for b in builds:
_notice(self.opts, 'cleaning: %s' % (b.name())) _notice(self.opts, 'cleaning: %s' % (b.name()))
b.cleanup() b.cleanup()
@ -262,7 +268,8 @@ class buildset:
def run(): def run():
import sys import sys
try: try:
optargs = { '--list-configs': 'List available configurations', optargs = { '--keep-going': 'Do not stop on error.',
'--list-configs': 'List available configurations',
'--list-bsets': 'List available build sets'} '--list-bsets': 'List available build sets'}
opts, _defaults = defaults.load(sys.argv, optargs) opts, _defaults = defaults.load(sys.argv, optargs)
log.default = log.log(opts.logfiles()) log.default = log.log(opts.logfiles())