also looking at this
fix: honor discovery-mode CLI options
#17
10 files
+192
-24
| @@ -74,6 +74,16 @@ pub fn main(init: std.process.Init.Minimal) !void { | ||
| 74 | 74 | // Check if we should use test discovery or programmatic tests |
| 75 | 75 | const use_discovery = cli_parser.options.test_dir != null; |
| 76 | 76 | |
| 77 | if (use_discovery) { | |
| 78 | if (cli_parser.unsupportedDiscoveryOption()) |option| { | |
| 79 | std.debug.print( | |
| 80 | "Error: {s} cannot be honored in test discovery mode\n", | |
| 81 | .{option}, | |
| 82 | ); | |
| 83 | std.process.exit(2); | |
| 84 | } | |
| 85 | } | |
| 86 | ||
| 77 | 87 | // Start UI server if requested |
| 78 | 88 | var ui_server: ?lib.UIServer = null; |
| 79 | 89 | var ui_thread: ?std.Thread = null; |
| @@ -176,6 +186,7 @@ pub fn main(init: std.process.Init.Minimal) !void { | ||
| 176 | 186 | .bail = cli_parser.options.bail, |
| 177 | 187 | .filter = cli_parser.options.filter, |
| 178 | 188 | .verbose = cli_parser.options.verbose, |
| 189 | .use_colors = !cli_parser.options.no_color, | |
| 179 | 190 | .coverage_options = cov_opts, |
| 180 | 191 | .ui_server = if (ui_server) |*server| server else null, |
| 181 | 192 | }; |
| @@ -192,7 +203,7 @@ pub fn main(init: std.process.Init.Minimal) !void { | ||
| 192 | 203 | .recursive = !cli_parser.options.no_recursive, |
| 193 | 204 | }; |
| 194 | 205 | |
| 195 | std.debug.print("Discovering tests in '{s}' with pattern '*{s}'...\n\n", .{ discovery_options.root_path, discovery_options.pattern }); | |
| 206 | std.debug.print("Discovering tests in '{s}' with pattern '{s}'...\n\n", .{ discovery_options.root_path, discovery_options.pattern }); | |
| 196 | 207 | |
| 197 | 208 | var discovered = try lib.discoverTests(allocator, discovery_options); |
| 198 | 209 | defer discovered.deinit(); |
| @@ -213,6 +224,7 @@ pub fn main(init: std.process.Init.Minimal) !void { | ||
| 213 | 224 | .bail = cli_parser.options.bail, |
| 214 | 225 | .filter = cli_parser.options.filter, |
| 215 | 226 | .verbose = cli_parser.options.verbose, |
| 227 | .use_colors = !cli_parser.options.no_color, | |
| 216 | 228 | .coverage_options = cov_opts, |
| 217 | 229 | .ui_server = if (ui_server) |*server| server else null, |
| 218 | 230 | }; |