also looking at this
test(bridge): the other direction — what window.craft promises
#141
2 files
+220
-0
| @@ -411,6 +411,28 @@ pub fn build(b: *std.Build) void { | ||
| 411 | 411 | // pointers, so the tests build one out of Zig functions and run anywhere — |
| 412 | 412 | // no JVM, no emulator, no NDK. That is the whole reason the layer is shaped |
| 413 | 413 | // the way it is. |
| 414 | // The page surface, across both bridges. Not folded into the iOS | |
| 415 | // conformance gate: it embeds three files and is about what `window.craft` | |
| 416 | // offers rather than about iOS, and the iOS gate is already the largest | |
| 417 | // test in the tree. | |
| 418 | const bridge_surface_tests = b.addTest(.{ | |
| 419 | .root_module = b.createModule(.{ | |
| 420 | .root_source_file = b.path("test/bridge_surface_test.zig"), | |
| 421 | .target = target, | |
| 422 | .optimize = optimize, | |
| 423 | }), | |
| 424 | }); | |
| 425 | bridge_surface_tests.root_module.addAnonymousImport("CraftApp.swift", .{ | |
| 426 | .root_source_file = b.path("../ios/templates/CraftApp.swift"), | |
| 427 | }); | |
| 428 | bridge_surface_tests.root_module.addAnonymousImport("CraftBridge.kt", .{ | |
| 429 | .root_source_file = b.path("../android/templates/CraftBridge.kt.template"), | |
| 430 | }); | |
| 431 | bridge_surface_tests.root_module.addAnonymousImport("craft.d.ts", .{ | |
| 432 | .root_source_file = b.path("../typescript/types/craft.d.ts"), | |
| 433 | }); | |
| 434 | const run_bridge_surface_tests = b.addRunArtifact(bridge_surface_tests); | |
| 435 | ||
| 414 | 436 | const jni_tests = b.addTest(.{ |
| 415 | 437 | .root_module = b.createModule(.{ |
| 416 | 438 | .root_source_file = b.path("src/jni_runtime.zig"), |
| @@ -1574,6 +1596,7 @@ pub fn build(b: *std.Build) void { | ||
| 1574 | 1596 | } |
| 1575 | 1597 | test_step.dependOn(&run_ios_conformance_tests.step); |
| 1576 | 1598 | test_step.dependOn(&run_jni_tests.step); |
| 1599 | test_step.dependOn(&run_bridge_surface_tests.step); | |
| 1577 | 1600 | test_step.dependOn(&run_android_bridge_tests.step); |
| 1578 | 1601 | test_step.dependOn(&run_menubar_tests.step); |
| 1579 | 1602 | test_step.dependOn(&run_components_tests.step); |
| @@ -1660,6 +1683,7 @@ pub fn build(b: *std.Build) void { | ||
| 1660 | 1683 | test_ios_step.dependOn(&run_ios_module_tests.step); |
| 1661 | 1684 | } |
| 1662 | 1685 | test_ios_step.dependOn(&run_ios_conformance_tests.step); |
| 1686 | test_ios_step.dependOn(&run_bridge_surface_tests.step); | |
| 1663 | 1687 | |
| 1664 | 1688 | const test_menubar_step = b.step("test:menubar", "Run Menubar tests"); |
| 1665 | 1689 | test_menubar_step.dependOn(&run_menubar_tests.step); |
| @@ -2300,6 +2324,7 @@ pub fn build(b: *std.Build) void { | ||
| 2300 | 2324 | // second one: `jni_runtime.zig` is the only way anything here reaches Java, |
| 2301 | 2325 | // so a run that skipped it would not be an Android test run. |
| 2302 | 2326 | test_android_step.dependOn(&run_jni_tests.step); |
| 2327 | test_android_step.dependOn(&run_bridge_surface_tests.step); | |
| 2303 | 2328 | test_android_step.dependOn(&run_android_bridge_tests.step); |
| 2304 | 2329 | |
| 2305 | 2330 | // Add Android tests to the main test step |