@@ -482,6 +482,48 @@ pub fn build(b: *std.Build) void {
482482 inline_ir_matrix_step .dependOn (& run_inline_ir_matrix_tests .step );
483483 test_step .dependOn (& run_inline_ir_matrix_tests .step );
484484
485+ // ── FFI Layout Mismatch Tests ──
486+ const ffi_layout_step = b .step ("test-ffi-layout" , "Run FFI layout mismatch detection tests" );
487+ const ffi_layout_mod = b .addModule ("test_ffi_layout" , .{
488+ .root_source_file = b .path ("tests/integration/test_ffi_layout.zig" ),
489+ .target = target ,
490+ });
491+ ffi_layout_mod .addImport ("OmniScope" , lib_mod );
492+ ffi_layout_mod .addIncludePath (.{ .cwd_relative = b .pathJoin (&.{ llvm_path , "include" }) });
493+ const ffi_layout_tests = b .addTest (.{ .root_module = ffi_layout_mod });
494+ configureLLVM (b , ffi_layout_tests , llvm_path , llvm_version );
495+ const run_ffi_layout_tests = b .addRunArtifact (ffi_layout_tests );
496+ run_ffi_layout_tests .step .dependOn (b .getInstallStep ());
497+ ffi_layout_step .dependOn (& run_ffi_layout_tests .step );
498+
499+ // ── FFI String Safety Tests ──
500+ const ffi_string_step = b .step ("test-ffi-string" , "Run FFI string safety detection tests" );
501+ const ffi_string_mod = b .addModule ("test_ffi_string" , .{
502+ .root_source_file = b .path ("tests/integration/test_ffi_string.zig" ),
503+ .target = target ,
504+ });
505+ ffi_string_mod .addImport ("OmniScope" , lib_mod );
506+ ffi_string_mod .addIncludePath (.{ .cwd_relative = b .pathJoin (&.{ llvm_path , "include" }) });
507+ const ffi_string_tests = b .addTest (.{ .root_module = ffi_string_mod });
508+ configureLLVM (b , ffi_string_tests , llvm_path , llvm_version );
509+ const run_ffi_string_tests = b .addRunArtifact (ffi_string_tests );
510+ run_ffi_string_tests .step .dependOn (b .getInstallStep ());
511+ ffi_string_step .dependOn (& run_ffi_string_tests .step );
512+
513+ // ── FFI Unwind Boundary Tests ──
514+ const ffi_unwind_step = b .step ("test-ffi-unwind" , "Run FFI unwind boundary detection tests" );
515+ const ffi_unwind_mod = b .addModule ("test_ffi_unwind" , .{
516+ .root_source_file = b .path ("tests/integration/test_ffi_unwind.zig" ),
517+ .target = target ,
518+ });
519+ ffi_unwind_mod .addImport ("OmniScope" , lib_mod );
520+ ffi_unwind_mod .addIncludePath (.{ .cwd_relative = b .pathJoin (&.{ llvm_path , "include" }) });
521+ const ffi_unwind_tests = b .addTest (.{ .root_module = ffi_unwind_mod });
522+ configureLLVM (b , ffi_unwind_tests , llvm_path , llvm_version );
523+ const run_ffi_unwind_tests = b .addRunArtifact (ffi_unwind_tests );
524+ run_ffi_unwind_tests .step .dependOn (b .getInstallStep ());
525+ ffi_unwind_step .dependOn (& run_ffi_unwind_tests .step );
526+
485527 // Help information
486528 const help_step = b .step ("help" , "Show build options" );
487529 help_step .dependOn (& b .addSystemCommand (&.{
0 commit comments