also looking at this
test: make CI exercise maintained integrations
#18
16 files
+390
-139
| @@ -19,6 +19,9 @@ pub fn build(b: *std.Build) void { | ||
| 19 | 19 | .target = target, |
| 20 | 20 | .optimize = optimize, |
| 21 | 21 | .link_libc = true, |
| 22 | .imports = &.{ | |
| 23 | .{ .name = "zig_test_framework", .module = lib_module }, | |
| 24 | }, | |
| 22 | 25 | }), |
| 23 | 26 | }); |
| 24 | 27 | |
| @@ -46,6 +49,9 @@ pub fn build(b: *std.Build) void { | ||
| 46 | 49 | .target = target, |
| 47 | 50 | .optimize = optimize, |
| 48 | 51 | .link_libc = true, |
| 52 | .imports = &.{ | |
| 53 | .{ .name = "zig_test_framework", .module = lib_module }, | |
| 54 | }, | |
| 49 | 55 | }), |
| 50 | 56 | }); |
| 51 | 57 | const run_test_runner_tests = b.addRunArtifact(test_runner_tests); |
| @@ -57,6 +63,9 @@ pub fn build(b: *std.Build) void { | ||
| 57 | 63 | .target = target, |
| 58 | 64 | .optimize = optimize, |
| 59 | 65 | .link_libc = true, |
| 66 | .imports = &.{ | |
| 67 | .{ .name = "zig_test_framework", .module = lib_module }, | |
| 68 | }, | |
| 60 | 69 | }), |
| 61 | 70 | }); |
| 62 | 71 | const run_assertions_tests = b.addRunArtifact(assertions_tests); |
| @@ -68,6 +77,9 @@ pub fn build(b: *std.Build) void { | ||
| 68 | 77 | .target = target, |
| 69 | 78 | .optimize = optimize, |
| 70 | 79 | .link_libc = true, |
| 80 | .imports = &.{ | |
| 81 | .{ .name = "zig_test_framework", .module = lib_module }, | |
| 82 | }, | |
| 71 | 83 | }), |
| 72 | 84 | }); |
| 73 | 85 | const run_suite_tests = b.addRunArtifact(suite_tests); |
| @@ -79,6 +91,9 @@ pub fn build(b: *std.Build) void { | ||
| 79 | 91 | .target = target, |
| 80 | 92 | .optimize = optimize, |
| 81 | 93 | .link_libc = true, |
| 94 | .imports = &.{ | |
| 95 | .{ .name = "zig_test_framework", .module = lib_module }, | |
| 96 | }, | |
| 82 | 97 | }), |
| 83 | 98 | }); |
| 84 | 99 | const run_matchers_tests = b.addRunArtifact(matchers_tests); |
| @@ -108,6 +123,9 @@ pub fn build(b: *std.Build) void { | ||
| 108 | 123 | .target = target, |
| 109 | 124 | .optimize = optimize, |
| 110 | 125 | .link_libc = true, |
| 126 | .imports = &.{ | |
| 127 | .{ .name = "zig_test_framework", .module = lib_module }, | |
| 128 | }, | |
| 111 | 129 | }), |
| 112 | 130 | }); |
| 113 | 131 | const run_reporter_tests = b.addRunArtifact(reporter_tests); |
| @@ -119,6 +137,9 @@ pub fn build(b: *std.Build) void { | ||
| 119 | 137 | .target = target, |
| 120 | 138 | .optimize = optimize, |
| 121 | 139 | .link_libc = true, |
| 140 | .imports = &.{ | |
| 141 | .{ .name = "zig_test_framework", .module = lib_module }, | |
| 142 | }, | |
| 122 | 143 | }), |
| 123 | 144 | }); |
| 124 | 145 | const run_cli_tests = b.addRunArtifact(cli_tests); |
| @@ -144,6 +165,9 @@ pub fn build(b: *std.Build) void { | ||
| 144 | 165 | .target = target, |
| 145 | 166 | .optimize = optimize, |
| 146 | 167 | .link_libc = true, |
| 168 | .imports = &.{ | |
| 169 | .{ .name = "zig_test_framework", .module = lib_module }, | |
| 170 | }, | |
| 147 | 171 | }), |
| 148 | 172 | }); |
| 149 | 173 | const run_mock_tests = b.addRunArtifact(mock_tests); |
| @@ -209,11 +233,14 @@ pub fn build(b: *std.Build) void { | ||
| 209 | 233 | test_step.dependOn(&run_assertions_tests.step); |
| 210 | 234 | test_step.dependOn(&run_suite_tests.step); |
| 211 | 235 | test_step.dependOn(&run_matchers_tests.step); |
| 212 | // Note: hooks_test is an executable, run with 'zig build test-hooks' | |
| 236 | test_step.dependOn(&run_hooks_tests.step); | |
| 213 | 237 | test_step.dependOn(&run_reporter_tests.step); |
| 214 | 238 | test_step.dependOn(&run_cli_tests.step); |
| 215 | 239 | test_step.dependOn(&run_filter_tests.step); |
| 216 | 240 | test_step.dependOn(&run_mock_tests.step); |
| 241 | test_step.dependOn(&run_comprehensive_mock_tests.step); | |
| 242 | test_step.dependOn(&run_snapshot_usage_tests.step); | |
| 243 | test_step.dependOn(&run_time_tests.step); | |
| 217 | 244 | |
| 218 | 245 | // Examples |
| 219 | 246 | const basic_example = b.addExecutable(.{ |
| @@ -245,7 +272,65 @@ pub fn build(b: *std.Build) void { | ||
| 245 | 272 | const run_basic_example = b.addRunArtifact(basic_example); |
| 246 | 273 | const run_advanced_example = b.addRunArtifact(advanced_example); |
| 247 | 274 | |
| 248 | const examples_step = b.step("examples", "Run all examples"); | |
| 275 | // These showcase intentionally slow, interactive, or failure-oriented | |
| 276 | // scenarios, so keep them compile-only while still checking every example. | |
| 277 | const async_examples = b.addExecutable(.{ | |
| 278 | .name = "async_examples", | |
| 279 | .root_module = b.createModule(.{ | |
| 280 | .root_source_file = b.path("examples/async_tests.zig"), | |
| 281 | .target = target, | |
| 282 | .optimize = optimize, | |
| 283 | .link_libc = true, | |
| 284 | .imports = &.{ | |
| 285 | .{ .name = "zig_test", .module = lib_module }, | |
| 286 | }, | |
| 287 | }), | |
| 288 | }); | |
| 289 | ||
| 290 | const snapshot_examples = b.addExecutable(.{ | |
| 291 | .name = "snapshot_examples", | |
| 292 | .root_module = b.createModule(.{ | |
| 293 | .root_source_file = b.path("examples/snapshot_examples.zig"), | |
| 294 | .target = target, | |
| 295 | .optimize = optimize, | |
| 296 | .link_libc = true, | |
| 297 | .imports = &.{ | |
| 298 | .{ .name = "zig_test", .module = lib_module }, | |
| 299 | }, | |
| 300 | }), | |
| 301 | }); | |
| 302 | ||
| 303 | const progress_examples = b.addExecutable(.{ | |
| 304 | .name = "progress_examples", | |
| 305 | .root_module = b.createModule(.{ | |
| 306 | .root_source_file = b.path("examples/progress_examples.zig"), | |
| 307 | .target = target, | |
| 308 | .optimize = optimize, | |
| 309 | .link_libc = true, | |
| 310 | .imports = &.{ | |
| 311 | .{ .name = "zig_test", .module = lib_module }, | |
| 312 | }, | |
| 313 | }), | |
| 314 | }); | |
| 315 | ||
| 316 | const timeout_examples = b.addExecutable(.{ | |
| 317 | .name = "timeout_examples", | |
| 318 | .root_module = b.createModule(.{ | |
| 319 | .root_source_file = b.path("examples/timeout_examples.zig"), | |
| 320 | .target = target, | |
| 321 | .optimize = optimize, | |
| 322 | .link_libc = true, | |
| 323 | .imports = &.{ | |
| 324 | .{ .name = "zig_test", .module = lib_module }, | |
| 325 | }, | |
| 326 | }), | |
| 327 | }); | |
| 328 | ||
| 329 | const examples_step = b.step("examples", "Run core examples and compile all examples"); | |
| 249 | 330 | examples_step.dependOn(&run_basic_example.step); |
| 250 | 331 | examples_step.dependOn(&run_advanced_example.step); |
| 332 | examples_step.dependOn(&async_examples.step); | |
| 333 | examples_step.dependOn(&snapshot_examples.step); | |
| 334 | examples_step.dependOn(&progress_examples.step); | |
| 335 | examples_step.dependOn(&timeout_examples.step); | |
| 251 | 336 | } |