aboutsummaryrefslogtreecommitdiff
path: root/test/tests.zig
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2024-08-17 01:15:04 -0400
committerGitHub <noreply@github.com>2024-08-17 01:15:04 -0400
commitbb70501060a8bfff25818cf1d80491d724f8a634 (patch)
tree546c8d93fcbdf4e2f3e2656d5d4f45bc79e9d483 /test/tests.zig
parent90989be0e31a91335f8d1c1eafb84c3b34792a8c (diff)
parented19ecd115beedfbf496c6f20995e74fbcd8ccb4 (diff)
downloadzig-bb70501060a8bfff25818cf1d80491d724f8a634.tar.gz
zig-bb70501060a8bfff25818cf1d80491d724f8a634.zip
Merge pull request #21078 from jacobly0/new-dwarf
Dwarf: rework self-hosted debug info from scratch
Diffstat (limited to 'test/tests.zig')
-rw-r--r--test/tests.zig34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/tests.zig b/test/tests.zig
index e472fd4524..6b044e91ba 100644
--- a/test/tests.zig
+++ b/test/tests.zig
@@ -17,6 +17,7 @@ pub const TranslateCContext = @import("src/TranslateC.zig");
pub const RunTranslatedCContext = @import("src/RunTranslatedC.zig");
pub const CompareOutputContext = @import("src/CompareOutput.zig");
pub const StackTracesContext = @import("src/StackTrace.zig");
+pub const DebuggerContext = @import("src/Debugger.zig");
const TestTarget = struct {
target: std.Target.Query = .{},
@@ -1283,3 +1284,36 @@ pub fn addCases(
test_filters,
);
}
+
+pub fn addDebuggerTests(b: *std.Build, options: DebuggerContext.Options) ?*Step {
+ const step = b.step("test-debugger", "Run the debugger tests");
+ if (options.gdb == null and options.lldb == null) {
+ step.dependOn(&b.addFail("test-debugger requires -Dgdb and/or -Dlldb").step);
+ return null;
+ }
+
+ var context: DebuggerContext = .{
+ .b = b,
+ .options = options,
+ .root_step = step,
+ };
+ context.addTestsForTarget(.{
+ .resolved = b.resolveTargetQuery(.{
+ .cpu_arch = .x86_64,
+ .os_tag = .linux,
+ .abi = .none,
+ }),
+ .pic = false,
+ .test_name_suffix = "x86_64-linux",
+ });
+ context.addTestsForTarget(.{
+ .resolved = b.resolveTargetQuery(.{
+ .cpu_arch = .x86_64,
+ .os_tag = .linux,
+ .abi = .none,
+ }),
+ .pic = true,
+ .test_name_suffix = "x86_64-linux-pic",
+ });
+ return step;
+}