mirror of
https://github.com/ziglang/zig.git
synced 2026-01-21 06:45:24 +00:00
test-stack-traces: migrate from deprecated std.Build APIs
This commit is contained in:
parent
6d4e2a9171
commit
11b9933970
@ -44,9 +44,9 @@ fn addExpect(
|
||||
for (mode_config.exclude_os) |tag| if (tag == builtin.os.tag) return;
|
||||
|
||||
const b = self.b;
|
||||
const annotated_case_name = fmt.allocPrint(b.allocator, "check {s} ({s})", .{
|
||||
const annotated_case_name = b.fmt("check {s} ({s})", .{
|
||||
name, @tagName(optimize_mode),
|
||||
}) catch @panic("OOM");
|
||||
});
|
||||
for (self.test_filters) |test_filter| {
|
||||
if (mem.indexOf(u8, annotated_case_name, test_filter)) |_| break;
|
||||
} else if (self.test_filters.len > 0) return;
|
||||
@ -55,10 +55,12 @@ fn addExpect(
|
||||
const source_zig = write_files.add("source.zig", source);
|
||||
const exe = b.addExecutable(.{
|
||||
.name = "test",
|
||||
.root_source_file = source_zig,
|
||||
.optimize = optimize_mode,
|
||||
.target = b.graph.host,
|
||||
.error_tracing = mode_config.error_tracing,
|
||||
.root_module = b.createModule(.{
|
||||
.root_source_file = source_zig,
|
||||
.optimize = optimize_mode,
|
||||
.target = b.graph.host,
|
||||
.error_tracing = mode_config.error_tracing,
|
||||
}),
|
||||
});
|
||||
|
||||
const run = b.addRunArtifact(exe);
|
||||
@ -83,5 +85,4 @@ const std = @import("std");
|
||||
const builtin = @import("builtin");
|
||||
const Step = std.Build.Step;
|
||||
const OptimizeMode = std.builtin.OptimizeMode;
|
||||
const fmt = std.fmt;
|
||||
const mem = std.mem;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user