#NEWLINE# @ waflib . Configure . conf #NEWLINE# def hwaf_utest_summary( bld , * k , **kwargs ) : #NEWLINE# #INDENT# "\n    Display an execution summary::\n\n        def build(bld):\n            bld(features='cxx cxxprogram test', source='main.c', target='app')\n            bld.add_post_fun(hwaf_utest_summary)\n    " #NEWLINE# lst = getattr ( bld , 'hwaf_utest_results' , [ ] ) #NEWLINE# if lst : #NEWLINE# #INDENT# Logs . pprint ( 'CYAN' , ( '=' * 80 ) ) #NEWLINE# Logs . pprint ( 'CYAN' , 'unit-tests execution summary' ) #NEWLINE# total = len ( lst ) #NEWLINE# tfail = len ( [ x for x in lst if ( x [ 1 ] != x [ 4 ] ) ] ) #NEWLINE# val = ( ( 100 * ( total - tfail ) ) / ( 1.0 * total ) ) #NEWLINE# Logs . pprint ( 'CYAN' , ( 'test report %3.0f%% success' % val ) ) #NEWLINE# Logs . pprint ( 'CYAN' , ( '  tests that pass %d/%d' % ( ( total - tfail ) , total ) ) ) #NEWLINE# for ( f , code , out , err , exp_rc ) in lst : #NEWLINE# #INDENT# if ( code == exp_rc ) : #NEWLINE# #INDENT# Logs . pprint ( 'CYAN' , ( '    %s' % f ) ) #NEWLINE# pass #NEWLINE# #UNINDENT# pass #NEWLINE# #UNINDENT# Logs . pprint ( 'CYAN' , ( '  tests that fail %d/%d' % ( tfail , total ) ) ) #NEWLINE# for ( f , code , out , err , exp_rc ) in lst : #NEWLINE# #INDENT# if ( code != exp_rc ) : #NEWLINE# #INDENT# Logs . pprint ( 'CYAN' , ( '    %s (err=%d, exp=%d)' % ( f , code , exp_rc ) ) ) #NEWLINE# pass #NEWLINE# #UNINDENT# pass #NEWLINE# #UNINDENT# Logs . pprint ( 'CYAN' , ( '=' * 80 ) ) #NEWLINE# pass #NEWLINE# #UNINDENT# return