also looking at this
test(android): the ratchet, and the two seams JNI leaves unchecked
#142
2 files
+360
-0
| @@ -411,6 +411,31 @@ 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 Android action ratchet, and the JNI binding contract. Separate from | |
| 415 | // the iOS gate for the obvious reason and from the surface gate for a | |
| 416 | // subtler one: this is about what Zig owes Kotlin, not about what either | |
| 417 | // owes the page. | |
| 418 | const android_conformance_tests = b.addTest(.{ | |
| 419 | .root_module = b.createModule(.{ | |
| 420 | .root_source_file = b.path("test/android_conformance_test.zig"), | |
| 421 | .target = target, | |
| 422 | .optimize = optimize, | |
| 423 | }), | |
| 424 | }); | |
| 425 | android_conformance_tests.root_module.addAnonymousImport("CraftBridge.kt", .{ | |
| 426 | .root_source_file = b.path("../android/templates/CraftBridge.kt.template"), | |
| 427 | }); | |
| 428 | android_conformance_tests.root_module.addAnonymousImport("CraftNative.kt", .{ | |
| 429 | .root_source_file = b.path("../android/templates/CraftNative.kt.template"), | |
| 430 | }); | |
| 431 | android_conformance_tests.root_module.addAnonymousImport("src/android_dispatch.zig", .{ | |
| 432 | .root_source_file = b.path("src/android_dispatch.zig"), | |
| 433 | }); | |
| 434 | android_conformance_tests.root_module.addAnonymousImport("src/bridge_android_device.zig", .{ | |
| 435 | .root_source_file = b.path("src/bridge_android_device.zig"), | |
| 436 | }); | |
| 437 | const run_android_conformance_tests = b.addRunArtifact(android_conformance_tests); | |
| 438 | ||
| 414 | 439 | // The page surface, across both bridges. Not folded into the iOS |
| 415 | 440 | // conformance gate: it embeds three files and is about what `window.craft` |
| 416 | 441 | // offers rather than about iOS, and the iOS gate is already the largest |
| @@ -1597,6 +1622,7 @@ pub fn build(b: *std.Build) void { | ||
| 1597 | 1622 | test_step.dependOn(&run_ios_conformance_tests.step); |
| 1598 | 1623 | test_step.dependOn(&run_jni_tests.step); |
| 1599 | 1624 | test_step.dependOn(&run_bridge_surface_tests.step); |
| 1625 | test_step.dependOn(&run_android_conformance_tests.step); | |
| 1600 | 1626 | test_step.dependOn(&run_android_bridge_tests.step); |
| 1601 | 1627 | test_step.dependOn(&run_menubar_tests.step); |
| 1602 | 1628 | test_step.dependOn(&run_components_tests.step); |
| @@ -2325,6 +2351,7 @@ pub fn build(b: *std.Build) void { | ||
| 2325 | 2351 | // so a run that skipped it would not be an Android test run. |
| 2326 | 2352 | test_android_step.dependOn(&run_jni_tests.step); |
| 2327 | 2353 | test_android_step.dependOn(&run_bridge_surface_tests.step); |
| 2354 | test_android_step.dependOn(&run_android_conformance_tests.step); | |
| 2328 | 2355 | test_android_step.dependOn(&run_android_bridge_tests.step); |
| 2329 | 2356 | |
| 2330 | 2357 | // Add Android tests to the main test step |