Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions test/support/cdp_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,7 @@ def setup_chrome_debuggee
MSG
end

pt = ENV['RUBY_DEBUG_PROTOCOL_TEST']
PROTOCOL_TEST = pt == 'true' || pt == '1'

def connect_to_cdp_server
omit 'Tests for CDP were skipped. You can enable them with RUBY_DEBUG_PROTOCOL_TEST=1.' unless PROTOCOL_TEST

ENV['RUBY_DEBUG_TEST_MODE'] = 'true'

sock = Socket.tcp HOST, @remote_info.port
Expand Down Expand Up @@ -69,6 +64,8 @@ def connect_to_cdp_server
HOST = '127.0.0.1'

def run_cdp_scenario program, &msgs
return unless Protocol_TestUtils::PROTOCOL_TEST

ENV['RUBY_DEBUG_TEST_UI'] = 'chrome'

program = program.delete_suffix "\n"
Expand Down
4 changes: 1 addition & 3 deletions test/support/dap_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,9 @@ def connect_to_dap_server test_info
end

TIMEOUT_SEC = (ENV['RUBY_DEBUG_TIMEOUT_SEC'] || 10).to_i
dt = ENV['RUBY_DEBUG_PROTOCOL_TEST']
DAP_TEST = dt == 'true' || dt == '1'

def run_dap_scenario program, &msgs
omit 'Tests for DAP were skipped. You can enable them with RUBY_DEBUG_PROTOCOL_TEST=1.' unless DAP_TEST
return unless Protocol_TestUtils::PROTOCOL_TEST

begin
write_temp_file(strip_line_num(program))
Expand Down
6 changes: 5 additions & 1 deletion test/support/protocol_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,14 @@ class Detach < StandardError
pt = ENV['RUBY_DEBUG_PROTOCOL_TEST']
PROTOCOL_TEST = pt == 'true' || pt == '1'

unless PROTOCOL_TEST
warn 'Tests for CDP and DAP were skipped. You can enable them with RUBY_DEBUG_PROTOCOL_TEST=1.'
end

# API

def run_protocol_scenario program, dap: true, cdp: true, &scenario
omit 'Tests for CDP and DAP were skipped. You can enable them with RUBY_DEBUG_PROTOCOL_TEST=1.' unless PROTOCOL_TEST
return unless PROTOCOL_TEST

write_temp_file(strip_line_num(program))
execute_dap_scenario scenario if dap
Expand Down