@@ -91,7 +91,6 @@ enum test_result { tr_ok, tr_failed, tr_ignored, }
91
91
type console_test_state =
92
92
@{ out : io:: writer,
93
93
log_out: option < io:: writer > ,
94
- use_color : bool,
95
94
mut total : uint,
96
95
mut passed : uint,
97
96
mut failed : uint,
@@ -117,7 +116,6 @@ fn run_tests_console(opts: test_opts,
117
116
let st =
118
117
@{ out: io:: stdout ( ) ,
119
118
log_out: log_out,
120
- use_color: use_color ( ) ,
121
119
mut total: 0 u,
122
120
mut passed: 0 u,
123
121
mut failed: 0 u,
@@ -150,18 +148,18 @@ fn run_tests_console(opts: test_opts,
150
148
alt result {
151
149
tr_ok {
152
150
st. passed += 1 u;
153
- write_ok ( st. out , st . use_color ) ;
151
+ write_ok ( st. out ) ;
154
152
st. out . write_line ( "" ) ;
155
153
}
156
154
tr_failed {
157
155
st. failed += 1 u;
158
- write_failed ( st. out , st . use_color ) ;
156
+ write_failed ( st. out ) ;
159
157
st. out . write_line ( "" ) ;
160
158
st. failures += [ test] ;
161
159
}
162
160
tr_ignored {
163
161
st. ignored += 1 u;
164
- write_ignored ( st. out , st . use_color ) ;
162
+ write_ignored ( st. out ) ;
165
163
st. out . write_line ( "" ) ;
166
164
}
167
165
}
@@ -180,11 +178,9 @@ fn run_tests_console(opts: test_opts,
180
178
}
181
179
182
180
st. out . write_str ( #fmt[ "\n result: " ] ) ;
183
- if success {
184
- write_ok ( st. out , true ) ;
185
- } else { write_failed ( st. out , true ) ; }
186
- st. out . write_str ( #fmt[ ". %u passed; %u failed; %u ignored\n \n " , st. passed ,
187
- st. failed , st. ignored ] ) ;
181
+ if success { write_ok ( st. out ) ; } else { write_failed ( st. out ) ; }
182
+ st. out . write_str ( #fmt[ ". %u passed; %u failed; %u ignored\n \n " ,
183
+ st. passed , st. failed , st. ignored ] ) ;
188
184
189
185
ret success;
190
186
@@ -197,24 +193,24 @@ fn run_tests_console(opts: test_opts,
197
193
} , test. name ) ) ;
198
194
}
199
195
200
- fn write_ok ( out : io:: writer , use_color : bool ) {
201
- write_pretty ( out, "ok" , term:: color_green, use_color ) ;
196
+ fn write_ok ( out : io:: writer ) {
197
+ write_pretty ( out, "ok" , term:: color_green) ;
202
198
}
203
199
204
- fn write_failed ( out : io:: writer , use_color : bool ) {
205
- write_pretty ( out, "FAILED" , term:: color_red, use_color ) ;
200
+ fn write_failed ( out : io:: writer ) {
201
+ write_pretty ( out, "FAILED" , term:: color_red) ;
206
202
}
207
203
208
- fn write_ignored ( out : io:: writer , use_color : bool ) {
209
- write_pretty ( out, "ignored" , term:: color_yellow, use_color ) ;
204
+ fn write_ignored ( out : io:: writer ) {
205
+ write_pretty ( out, "ignored" , term:: color_yellow) ;
210
206
}
211
207
212
- fn write_pretty ( out : io:: writer , word : str , color : u8 , use_color : bool ) {
213
- if use_color && term:: color_supported ( ) {
208
+ fn write_pretty ( out : io:: writer , word : str , color : u8 ) {
209
+ if term:: color_supported ( ) {
214
210
term:: fg ( out, color) ;
215
211
}
216
212
out. write_str ( word) ;
217
- if use_color && term:: color_supported ( ) {
213
+ if term:: color_supported ( ) {
218
214
term:: reset ( out) ;
219
215
}
220
216
}
@@ -251,7 +247,6 @@ fn should_sort_failures_before_printing_them() {
251
247
let st =
252
248
@{out: writer,
253
249
log_out: option::none,
254
- use_color: false,
255
250
mut total: 0u,
256
251
mut passed: 0u,
257
252
mut failed: 0u,
@@ -267,8 +262,6 @@ fn should_sort_failures_before_printing_them() {
267
262
assert apos < bpos;
268
263
}
269
264
270
- fn use_color ( ) -> bool { ret get_concurrency ( ) == 1 u; }
271
-
272
265
enum testevent {
273
266
te_filtered( [ test_desc ] ) ,
274
267
te_wait( test_desc ) ,
0 commit comments