| ... | ... | @@ -1486,19 +1486,32 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step { |
| 1486 | 1486 | return step; |
| 1487 | 1487 | } |
| 1488 | 1488 | |
| 1489 | | pub fn addCAbiTests(b: *std.Build, skip_non_native: bool, skip_release: bool) *Step { |
| 1489 | const CAbiTestOptions = struct { |
| 1490 | test_target_filters: []const []const u8, |
| 1491 | skip_non_native: bool, |
| 1492 | skip_release: bool, |
| 1493 | }; |
| 1494 | |
| 1495 | pub fn addCAbiTests(b: *std.Build, options: CAbiTestOptions) *Step { |
| 1490 | 1496 | const step = b.step("test-c-abi", "Run the C ABI tests"); |
| 1491 | 1497 | |
| 1492 | 1498 | const optimize_modes: [3]OptimizeMode = .{ .Debug, .ReleaseSafe, .ReleaseFast }; |
| 1493 | 1499 | |
| 1494 | 1500 | for (optimize_modes) |optimize_mode| { |
| 1495 | | if (optimize_mode != .Debug and skip_release) continue; |
| 1501 | if (optimize_mode != .Debug and options.skip_release) continue; |
| 1496 | 1502 | |
| 1497 | 1503 | for (c_abi_targets) |c_abi_target| { |
| 1498 | | if (skip_non_native and !c_abi_target.target.isNative()) continue; |
| 1504 | if (options.skip_non_native and !c_abi_target.target.isNative()) continue; |
| 1499 | 1505 | |
| 1500 | 1506 | const resolved_target = b.resolveTargetQuery(c_abi_target.target); |
| 1501 | 1507 | const target = resolved_target.result; |
| 1508 | const triple_txt = target.zigTriple(b.allocator) catch @panic("OOM"); |
| 1509 | |
| 1510 | if (options.test_target_filters.len > 0) { |
| 1511 | for (options.test_target_filters) |filter| { |
| 1512 | if (std.mem.indexOf(u8, triple_txt, filter) != null) break; |
| 1513 | } else continue; |
| 1514 | } |
| 1502 | 1515 | |
| 1503 | 1516 | if (target.os.tag == .windows and target.cpu.arch == .aarch64) { |
| 1504 | 1517 | // https://github.com/ziglang/zig/issues/14908 |
| ... | ... | @@ -1507,7 +1520,7 @@ pub fn addCAbiTests(b: *std.Build, skip_non_native: bool, skip_release: bool) *S |
| 1507 | 1520 | |
| 1508 | 1521 | const test_step = b.addTest(.{ |
| 1509 | 1522 | .name = b.fmt("test-c-abi-{s}-{s}-{s}{s}{s}{s}", .{ |
| 1510 | | target.zigTriple(b.allocator) catch @panic("OOM"), |
| 1523 | triple_txt, |
| 1511 | 1524 | target.cpu.model.name, |
| 1512 | 1525 | @tagName(optimize_mode), |
| 1513 | 1526 | if (c_abi_target.use_llvm == true) |