1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# Go Hello World Test
# Tests Go debugging with Delve (dlv)
#
# NOTE: Delve uses TCP-based DAP connections rather than stdin/stdout.
# This test requires TCP-based DAP adapter support to be implemented.
# Currently expected to fail until that feature is added.
name: "Go Hello World Test"
description: "Verifies basic Go debugging functionality with Delve"
# Compile the test program with debug info
setup:
- shell: "go build -gcflags='all=-N -l' -o tests/e2e/test_go tests/e2e/hello_world.go"
# Debug target configuration
target:
program: "../e2e/test_go"
args:
adapter: "go"
stop_on_entry: true
# Test steps
steps:
# 1. Set a breakpoint at main.main
- action: command
command: "break main.main"
expect:
success: true
# 2. Continue to the breakpoint
- action: command
command: "continue"
# 3. Wait for stop at breakpoint
- action: await
timeout: 10
expect:
reason: "breakpoint"
file: "hello_world.go"
# 4. Step over to initialize x
- action: command
command: "next"
# 5. Wait for step to complete
- action: await
timeout: 10
expect:
reason: "step"
# 6. Step over to initialize y
- action: command
command: "next"
- action: await
timeout: 10
expect:
reason: "step"
# 7. Step over to initialize sum
- action: command
command: "next"
- action: await
timeout: 10
expect:
reason: "step"
# 8. Step past sum assignment to make variable visible
- action: command
command: "next"
- action: await
timeout: 10
expect:
reason: "step"
# 9. Check local variables (now sum is available)
- action: inspect_locals
asserts:
- name: "x"
value_contains: "10"
- name: "y"
value_contains: "20"
- name: "sum"
value_contains: "30"
# 9. Check stack trace
- action: inspect_stack
asserts:
- index: 0
function: "main.main"
# 12. Continue to exit
- action: command
command: "continue"
# 13. Wait for program exit (Delve sends "terminated" event)
- action: await
timeout: 10
expect:
reason: "terminated"