Skip to content

Commit d527ed4

Browse files
committed
---
yaml --- r: 15453 b: refs/heads/try c: 7b3cb05 h: refs/heads/master i: 15451: a7239ef v: v3
1 parent 4308c0b commit d527ed4

File tree

2 files changed

+16
-23
lines changed

2 files changed

+16
-23
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: 828d0677c4d6d9cc955f9b90e8b28039f69ff8b8
5+
refs/heads/try: 7b3cb05311ef7d671b0bf92b041112ef141dc188
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/libstd/test.rs

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ enum test_result { tr_ok, tr_failed, tr_ignored, }
9191
type console_test_state =
9292
@{out: io::writer,
9393
log_out: option<io::writer>,
94-
use_color: bool,
9594
mut total: uint,
9695
mut passed: uint,
9796
mut failed: uint,
@@ -117,7 +116,6 @@ fn run_tests_console(opts: test_opts,
117116
let st =
118117
@{out: io::stdout(),
119118
log_out: log_out,
120-
use_color: use_color(),
121119
mut total: 0u,
122120
mut passed: 0u,
123121
mut failed: 0u,
@@ -150,18 +148,18 @@ fn run_tests_console(opts: test_opts,
150148
alt result {
151149
tr_ok {
152150
st.passed += 1u;
153-
write_ok(st.out, st.use_color);
151+
write_ok(st.out);
154152
st.out.write_line("");
155153
}
156154
tr_failed {
157155
st.failed += 1u;
158-
write_failed(st.out, st.use_color);
156+
write_failed(st.out);
159157
st.out.write_line("");
160158
st.failures += [test];
161159
}
162160
tr_ignored {
163161
st.ignored += 1u;
164-
write_ignored(st.out, st.use_color);
162+
write_ignored(st.out);
165163
st.out.write_line("");
166164
}
167165
}
@@ -180,11 +178,9 @@ fn run_tests_console(opts: test_opts,
180178
}
181179

182180
st.out.write_str(#fmt["\nresult: "]);
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]);
188184

189185
ret success;
190186

@@ -197,24 +193,24 @@ fn run_tests_console(opts: test_opts,
197193
}, test.name));
198194
}
199195

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);
202198
}
203199

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);
206202
}
207203

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);
210206
}
211207

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() {
214210
term::fg(out, color);
215211
}
216212
out.write_str(word);
217-
if use_color && term::color_supported() {
213+
if term::color_supported() {
218214
term::reset(out);
219215
}
220216
}
@@ -251,7 +247,6 @@ fn should_sort_failures_before_printing_them() {
251247
let st =
252248
@{out: writer,
253249
log_out: option::none,
254-
use_color: false,
255250
mut total: 0u,
256251
mut passed: 0u,
257252
mut failed: 0u,
@@ -267,8 +262,6 @@ fn should_sort_failures_before_printing_them() {
267262
assert apos < bpos;
268263
}
269264

270-
fn use_color() -> bool { ret get_concurrency() == 1u; }
271-
272265
enum testevent {
273266
te_filtered([test_desc]),
274267
te_wait(test_desc),

0 commit comments

Comments
 (0)