Skip to content

Commit f30ebfc

Browse files
committed
Add the new test framework for DAP and CDP
1 parent cd1c05c commit f30ebfc

File tree

6 files changed

+704
-1
lines changed

6 files changed

+704
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@
1010
/Gemfile.lock
1111
/lib/debug/debug.so
1212
.ruby-version
13+
/debugAdapterProtocol.json
14+
/chromeDevToolsProtocol.json

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ gem "rake"
66
gem "rake-compiler"
77
gem "test-unit", "~> 3.0"
88
gem "test-unit-rr"
9+
gem "json-schema"

lib/debug/server_dap.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ def dap_setup bytes
145145
def send **kw
146146
kw[:seq] = @seq += 1
147147
str = JSON.dump(kw)
148-
show_protocol '<', str
149148
@sock.write "Content-Length: #{str.bytesize}\r\n\r\n#{str}"
149+
show_protocol '<', str
150150
end
151151

152152
def send_response req, success: true, message: nil, **kw

test/support/assertions.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ def assert_line_num(expected)
1212
expected == test_info.internal_info['line']
1313
end
1414
})
15+
when 'vscode'
16+
send_request 'stackTrace',
17+
threadId: 1,
18+
startFrame: 0,
19+
levels: 20
20+
res = find_crt_dap_response
21+
failure_msg = FailureMessage.new{create_protocol_message "result:\n#{JSON.pretty_generate res}"}
22+
result = res.dig(:body, :stackFrames, 0, :line)
23+
assert_equal expected, result, failure_msg
24+
when 'chrome'
1525
else
1626
raise 'Invalid environment variable'
1727
end

0 commit comments

Comments
 (0)