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(
|
conf.multicheck(
|
||||||
{'header_name':'stdio.h', 'msg':'... stdio'},
|
{'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'},
|
{'header_name':'stdlib.h', 'msg':'... stdlib', 'okmsg': 'aye', 'errmsg': 'nope'},
|
||||||
{'func': test_build, 'msg':'... testing an arbitrary build function', 'okmsg':'ok'},
|
{'func': test_build, 'msg':'... testing an arbitrary build function', 'okmsg':'ok'},
|
||||||
msg = 'Checking for headers in parallel',
|
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)
|
conf.check_cc(header_name='stdio.h', auto_add_header_name=True)
|
||||||
|
|
|
@ -1274,7 +1274,12 @@ class cfgtask(Task.TaskBase):
|
||||||
errmsg=args.get('errmsg', ''),
|
errmsg=args.get('errmsg', ''),
|
||||||
)
|
)
|
||||||
else:
|
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:
|
except Exception:
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
@ -1327,12 +1332,15 @@ def multicheck(self, *k, **kw):
|
||||||
self.end_msg('fail', color='RED')
|
self.end_msg('fail', color='RED')
|
||||||
raise Errors.WafError('There is an error in the library, read config.log for more information')
|
raise Errors.WafError('There is an error in the library, read config.log for more information')
|
||||||
|
|
||||||
|
failure_count = 0
|
||||||
for x in tasks:
|
for x in tasks:
|
||||||
if x.hasrun != Task.SUCCESS:
|
if x.hasrun != Task.SUCCESS:
|
||||||
self.end_msg(kw.get('errmsg', 'no'), color='YELLOW', **kw)
|
failure_count += 1
|
||||||
break
|
|
||||||
|
if failure_count:
|
||||||
|
self.end_msg(kw.get('errmsg', '%s test failed' % failure_count), color='YELLOW', **kw)
|
||||||
else:
|
else:
|
||||||
self.end_msg('ok', **kw)
|
self.end_msg('all ok', **kw)
|
||||||
|
|
||||||
# optional output lines on msg/okmsg/errmsg
|
# optional output lines on msg/okmsg/errmsg
|
||||||
for x in tasks:
|
for x in tasks:
|
||||||
|
@ -1344,6 +1352,6 @@ def multicheck(self, *k, **kw):
|
||||||
self.end_msg(x.args.get('okmsg', 'yes'), 'GREEN')
|
self.end_msg(x.args.get('okmsg', 'yes'), 'GREEN')
|
||||||
for x in tasks:
|
for x in tasks:
|
||||||
if x.hasrun != Task.SUCCESS:
|
if x.hasrun != Task.SUCCESS:
|
||||||
self.end_msg(kw.get('errmsg', 'no'), color='YELLOW', **kw)
|
if x.args.get('mandatory', True):
|
||||||
self.fatal(kw.get('fatalmsg') or 'One of the tests has failed, read config.log for more information')
|
self.fatal(kw.get('fatalmsg') or 'One of the tests has failed, read config.log for more information')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue