aboutsummaryrefslogtreecommitdiff
path: root/test/src/Debugger.zig
diff options
context:
space:
mode:
authorAlex Rønne Petersen <alex@alexrp.com>2024-11-23 18:06:27 +0100
committerAlex Rønne Petersen <alex@alexrp.com>2024-11-24 22:11:17 +0100
commit9d10246a809752be6952ba3d9021e8cbfc1931a1 (patch)
treeedd5bfe30c41960f50853a5bb73faa10a47ee66e /test/src/Debugger.zig
parent2a29381117be7196378229d1c4e797f704675c61 (diff)
downloadzig-9d10246a809752be6952ba3d9021e8cbfc1931a1.tar.gz
zig-9d10246a809752be6952ba3d9021e8cbfc1931a1.zip
test: Enable -Dtest-target-filter=... to work for test-debugger.
Diffstat (limited to 'test/src/Debugger.zig')
-rw-r--r--test/src/Debugger.zig7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/src/Debugger.zig b/test/src/Debugger.zig
index b4b453700d..1c8e861a3e 100644
--- a/test/src/Debugger.zig
+++ b/test/src/Debugger.zig
@@ -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,