@@ -92,7 +92,7 @@ def get_color(res):
92
92
return BC_WHITE
93
93
else :
94
94
return BC_CYAN
95
- fmt_str = "{}{:<{}s}{endc} {}{:+.2f}{endc} {}{:+.2f}{endc} {:4d} {:4d }"
95
+ fmt_str = "{}{:<{}s}{endc}{}{:+9 .2f}{endc}{}{:+14 .2f}{endc}{:14d}{:14d }"
96
96
tres = calculate_change (bn ['real_time' ], other_bench ['real_time' ])
97
97
cpures = calculate_change (bn ['cpu_time' ], other_bench ['cpu_time' ])
98
98
output_strs += [color_format (use_color , fmt_str ,
@@ -121,19 +121,22 @@ def load_results(self):
121
121
122
122
def test_basic (self ):
123
123
expect_lines = [
124
- ['BM_SameTimes' , '+0.00' , '+0.00' ],
125
- ['BM_2xFaster' , '-0.50' , '-0.50' ],
126
- ['BM_2xSlower' , '+1.00' , '+1.00' ],
127
- ['BM_10PercentFaster' , '-0.10' , '-0.10' ],
128
- ['BM_10PercentSlower' , '+0.10' , '+0.10' ]
124
+ ['BM_SameTimes' , '+0.00' , '+0.00' , '10' , '10' ],
125
+ ['BM_2xFaster' , '-0.50' , '-0.50' , '50' , '25' ],
126
+ ['BM_2xSlower' , '+1.00' , '+1.00' , '50' , '100' ],
127
+ ['BM_10PercentFaster' , '-0.10' , '-0.10' , '100' , '90' ],
128
+ ['BM_10PercentSlower' , '+0.10' , '+0.10' , '100' , '110' ],
129
+ ['BM_100xSlower' , '+99.00' , '+99.00' , '100' , '10000' ],
130
+ ['BM_100xFaster' , '-0.99' , '-0.99' , '10000' , '100' ],
129
131
]
130
132
json1 , json2 = self .load_results ()
131
- output_lines = generate_difference_report (json1 , json2 , use_color = False )
132
- print output_lines
133
+ output_lines_with_header = generate_difference_report (json1 , json2 , use_color = False )
134
+ output_lines = output_lines_with_header [2 :]
135
+ print "\n " .join (output_lines_with_header )
133
136
self .assertEqual (len (output_lines ), len (expect_lines ))
134
137
for i in xrange (0 , len (output_lines )):
135
138
parts = [x for x in output_lines [i ].split (' ' ) if x ]
136
- self .assertEqual (len (parts ), 3 )
139
+ self .assertEqual (len (parts ), 5 )
137
140
self .assertEqual (parts , expect_lines [i ])
138
141
139
142
0 commit comments