mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
test: Enable -Dtest-target-filter=... to work for test-debugger.
This commit is contained in:
parent
2a29381117
commit
9d10246a80
2 changed files with 8 additions and 0 deletions
|
|
@ -552,6 +552,7 @@ pub fn build(b: *std.Build) !void {
|
|||
test_step.dependOn(tests.addAssembleAndLinkTests(b, test_filters, optimization_modes));
|
||||
if (tests.addDebuggerTests(b, .{
|
||||
.test_filters = test_filters,
|
||||
.test_target_filters = test_target_filters,
|
||||
.gdb = b.option([]const u8, "gdb", "path to gdb binary"),
|
||||
.lldb = b.option([]const u8, "lldb", "path to lldb binary"),
|
||||
.optimize_modes = optimization_modes,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ root_step: *std.Build.Step,
|
|||
|
||||
pub const Options = struct {
|
||||
test_filters: []const []const u8,
|
||||
test_target_filters: []const []const u8,
|
||||
gdb: ?[]const u8,
|
||||
lldb: ?[]const u8,
|
||||
optimize_modes: []const std.builtin.OptimizeMode,
|
||||
|
|
@ -1988,6 +1989,12 @@ fn addTest(
|
|||
for (db.options.test_filters) |test_filter| {
|
||||
if (std.mem.indexOf(u8, name, test_filter)) |_| return;
|
||||
}
|
||||
if (db.options.test_target_filters.len > 0) {
|
||||
const triple_txt = target.resolved.result.zigTriple(db.b.allocator) catch @panic("OOM");
|
||||
for (db.options.test_target_filters) |filter| {
|
||||
if (std.mem.indexOf(u8, triple_txt, filter) != null) break;
|
||||
} else return;
|
||||
}
|
||||
const files_wf = db.b.addWriteFiles();
|
||||
const exe = db.b.addExecutable(.{
|
||||
.name = name,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue