| ... | @@ -234,25 +234,33 @@ pub fn log( | ... | @@ -234,25 +234,33 @@ pub fn log( |
| 234 | /// work-in-progress backends can handle it. | 234 | /// work-in-progress backends can handle it. |
| 235 | pub fn mainSimple() anyerror!void { | 235 | pub fn mainSimple() anyerror!void { |
| 236 | const enable_print = false; | 236 | const enable_print = false; |
| | 237 | const print_all = false; |
| 237 | | 238 | |
| 238 | var passed: u64 = 0; | 239 | var passed: u64 = 0; |
| 239 | var skipped: u64 = 0; | 240 | var skipped: u64 = 0; |
| 240 | var failed: u64 = 0; | 241 | var failed: u64 = 0; |
| 241 | const stderr = if (enable_print) std.io.getStdErr() else {}; | 242 | const stderr = if (enable_print) std.io.getStdErr() else {}; |
| 242 | for (builtin.test_functions) |test_fn| { | 243 | for (builtin.test_functions) |test_fn| { |
| | 244 | if (enable_print and print_all) { |
| | 245 | stderr.writeAll(test_fn.name) catch {}; |
| | 246 | stderr.writeAll("... ") catch {}; |
| | 247 | } |
| 243 | test_fn.func() catch |err| { | 248 | test_fn.func() catch |err| { |
| 244 | if (enable_print) stderr.writeAll(test_fn.name) catch {}; | 249 | if (enable_print and !print_all) { |
| | 250 | stderr.writeAll(test_fn.name) catch {}; |
| | 251 | stderr.writeAll("... ") catch {}; |
| | 252 | } |
| 245 | if (err != error.SkipZigTest) { | 253 | if (err != error.SkipZigTest) { |
| 246 | if (enable_print) stderr.writeAll("... FAIL\n") catch {}; | 254 | if (enable_print) stderr.writeAll("FAIL\n") catch {}; |
| 247 | failed += 1; | 255 | failed += 1; |
| 248 | if (!enable_print) return err; | 256 | if (!enable_print) return err; |
| 249 | continue; | 257 | continue; |
| 250 | } | 258 | } |
| 251 | if (enable_print) stderr.writeAll("... SKIP\n") catch {}; | 259 | if (enable_print) stderr.writeAll("SKIP\n") catch {}; |
| 252 | skipped += 1; | 260 | skipped += 1; |
| 253 | continue; | 261 | continue; |
| 254 | }; | 262 | }; |
| 255 | //if (enable_print) stderr.writeAll("... PASS\n") catch {}; | 263 | if (enable_print and print_all) stderr.writeAll("PASS\n") catch {}; |
| 256 | passed += 1; | 264 | passed += 1; |
| 257 | } | 265 | } |
| 258 | if (enable_print) { | 266 | if (enable_print) { |