diff options
| author | Jacob Young <jacobly0@users.noreply.github.com> | 2024-08-06 11:22:37 -0400 |
|---|---|---|
| committer | Jacob Young <jacobly0@users.noreply.github.com> | 2024-08-16 15:22:55 -0400 |
| commit | ef11bc9899002620d67cfce9c79b6c0dc0f5ea61 (patch) | |
| tree | 7b05fe17340c06e4c40c45ebe249361c0c281c72 /test/tests.zig | |
| parent | 90989be0e31a91335f8d1c1eafb84c3b34792a8c (diff) | |
| download | zig-ef11bc9899002620d67cfce9c79b6c0dc0f5ea61.tar.gz zig-ef11bc9899002620d67cfce9c79b6c0dc0f5ea61.zip | |
Dwarf: rework self-hosted debug info from scratch
This is in preparation for incremental and actually being able to debug
executables built by the x86_64 backend.
Diffstat (limited to 'test/tests.zig')
| -rw-r--r-- | test/tests.zig | 34 |
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; +} |
