mirror of https://gitlab.com/ita1024/waf.git
Display failed configuration tests in yellow in multicheck
This commit is contained in:
parent
93bda59033
commit
ec6b72b0ad
|
@ -43,11 +43,11 @@ def configure(conf):
|
|||
|
||||
conf.multicheck(
|
||||
{'header_name':'stdio.h', 'msg':'... stdio'},
|
||||
{'header_name':'ueistd.h', 'msg':'... unistd', 'mandatory':False},
|
||||
{'header_name':'xyztabcd.h', 'msg':'... optional xyztabcd.h', 'mandatory': False},
|
||||
{'header_name':'stdlib.h', 'msg':'... stdlib', 'okmsg': 'aye', 'errmsg': 'nope'},
|
||||
{'func': test_build, 'msg':'... testing an arbitrary build function', 'okmsg':'ok'},
|
||||
msg = 'Checking for headers in parallel',
|
||||
mandatory = False
|
||||
mandatory = False # failures will not cause an error message
|
||||
)
|
||||
|
||||
conf.check_cc(header_name='stdio.h', auto_add_header_name=True)
|
||||
|
|
|
@ -1274,7 +1274,12 @@ class cfgtask(Task.TaskBase):
|
|||
errmsg=args.get('errmsg', ''),
|
||||
)
|
||||
else:
|
||||
bld.check(**args)
|
||||
args['multicheck_mandatory'] = args.get('mandatory', True)
|
||||
args['mandatory'] = True
|
||||
try:
|
||||
bld.check(**args)
|
||||
finally:
|
||||
args['mandatory'] = args['multicheck_mandatory']
|
||||
except Exception:
|
||||
return 1
|
||||
|
||||
|
@ -1327,12 +1332,15 @@ def multicheck(self, *k, **kw):
|
|||
self.end_msg('fail', color='RED')
|
||||
raise Errors.WafError('There is an error in the library, read config.log for more information')
|
||||
|
||||
failure_count = 0
|
||||
for x in tasks:
|
||||
if x.hasrun != Task.SUCCESS:
|
||||
self.end_msg(kw.get('errmsg', 'no'), color='YELLOW', **kw)
|
||||
break
|
||||
failure_count += 1
|
||||
|
||||
if failure_count:
|
||||
self.end_msg(kw.get('errmsg', '%s test failed' % failure_count), color='YELLOW', **kw)
|
||||
else:
|
||||
self.end_msg('ok', **kw)
|
||||
self.end_msg('all ok', **kw)
|
||||
|
||||
# optional output lines on msg/okmsg/errmsg
|
||||
for x in tasks:
|
||||
|
@ -1344,6 +1352,6 @@ def multicheck(self, *k, **kw):
|
|||
self.end_msg(x.args.get('okmsg', 'yes'), 'GREEN')
|
||||
for x in tasks:
|
||||
if x.hasrun != Task.SUCCESS:
|
||||
self.end_msg(kw.get('errmsg', 'no'), color='YELLOW', **kw)
|
||||
self.fatal(kw.get('fatalmsg') or 'One of the tests has failed, read config.log for more information')
|
||||
if x.args.get('mandatory', True):
|
||||
self.fatal(kw.get('fatalmsg') or 'One of the tests has failed, read config.log for more information')
|
||||
|
||||
|
|
Loading…
Reference in New Issue