also looking at this
Unify discovery and programmatic test execution
#23
12 files
+656
-169
| @@ -161,6 +161,11 @@ pub fn main(init: std.process.Init.Minimal) !void { | ||
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | var all_passed: bool = undefined; |
| 164 | const stdout_file = std.Io.File.stdout(); | |
| 165 | var stdout_buffer: [4096]u8 = undefined; | |
| 166 | var reporter_io: std.Io.Threaded = .init(std.mem.Allocator.failing, .{ .environ = .empty }); | |
| 167 | defer reporter_io.deinit(); | |
| 168 | var stdout_writer = stdout_file.writer(reporter_io.io(), &stdout_buffer); | |
| 164 | 169 | const shard_options: ?lib.ShardOptions = if (cli_parser.options.shard_index) |index| |
| 165 | 170 | .{ .index = index, .count = cli_parser.options.shard_count.? } |
| 166 | 171 | else |
| @@ -206,6 +211,10 @@ pub fn main(init: std.process.Init.Minimal) !void { | ||
| 206 | 211 | .verbose = cli_parser.options.verbose, |
| 207 | 212 | .use_colors = !cli_parser.options.no_color, |
| 208 | 213 | .shard = shard_options, |
| 214 | .reporter_type = cli_parser.options.reporter, | |
| 215 | .junit_output = cli_parser.options.junit_output orelse "test-results.xml", | |
| 216 | .timeout_ms = cli_parser.options.timeout, | |
| 217 | .reporter_writer = &stdout_writer.interface, | |
| 209 | 218 | .coverage_options = cov_opts, |
| 210 | 219 | .ui_server = if (ui_server) |*server| server else null, |
| 211 | 220 | }; |
| @@ -245,6 +254,10 @@ pub fn main(init: std.process.Init.Minimal) !void { | ||
| 245 | 254 | .verbose = cli_parser.options.verbose, |
| 246 | 255 | .use_colors = !cli_parser.options.no_color, |
| 247 | 256 | .shard = shard_options, |
| 257 | .reporter_type = cli_parser.options.reporter, | |
| 258 | .junit_output = cli_parser.options.junit_output orelse "test-results.xml", | |
| 259 | .timeout_ms = cli_parser.options.timeout, | |
| 260 | .reporter_writer = &stdout_writer.interface, | |
| 248 | 261 | .coverage_options = cov_opts, |
| 249 | 262 | .ui_server = if (ui_server) |*server| server else null, |
| 250 | 263 | }; |
| @@ -256,7 +269,8 @@ pub fn main(init: std.process.Init.Minimal) !void { | ||
| 256 | 269 | defer lib.cleanupRegistry(); |
| 257 | 270 | |
| 258 | 271 | // Create test runner with CLI options |
| 259 | const runner_options = cli_parser.toRunnerOptions(); | |
| 272 | var runner_options = cli_parser.toRunnerOptions(); | |
| 273 | runner_options.reporter_writer = &stdout_writer.interface; | |
| 260 | 274 | var runner = lib.TestRunner.init(allocator, registry, runner_options); |
| 261 | 275 | defer runner.deinit(); |
| 262 | 276 | |