-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test for remote debugger #76
Conversation
266c6ca
to
162bf9b
Compare
2aaf758
to
8184d3a
Compare
If we can further improve the current test framework and not relying on the internal info for testing (e.g. run tests by purely recording input/output), we can avoid patching either the server nor client for remote testing. This approach has some benefits:
|
@st0012 |
e695a6e
to
5ad682f
Compare
test/support/utils.rb
Outdated
r, w, server_pid = PTY.spawn("#{RUBY} #{boot_options} #{temp_file_path}") | ||
r.close | ||
sleep(0.1) | ||
cmd = "exe/rdbg -A" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should not use this path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
de725e0
to
62f4bce
Compare
could you introduce |
Also, now UNIX domain socket mode is supported. Could you add an option to test on TCP/IP mode? |
test/support/utils.rb
Outdated
inject_lib_to_load_path | ||
ENV['RUBY_DEBUG_USE_COLORIZE'] = "false" | ||
ENV['RUBY_DEBUG_TEST_MODE'] = 'true' | ||
|
||
timeout_sec = (ENV['RUBY_DEBUG_TIMEOUT_SEC'] || 10).to_i | ||
|
||
PTY.spawn("#{RUBY} #{boot_options} #{temp_file_path}") do |read, write, pid| | ||
if boot_options == "-r debug/open" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has bad smell.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I modified it.
62f4bce
to
cd8f3bd
Compare
0bb8d2b
to
70cf2a6
Compare
I did it by an environmental variable.
I supported it. |
@st0012 |
test/support/utils.rb
Outdated
cmd = "#{__dir__}/../../exe/rdbg -A" | ||
new_child_process("#{RUBY} #{boot_options} #{temp_file_path}") | ||
create_pseudo_terminal(cmd, repl_prompt) | ||
cmd = "#{__dir__}/../../exe/rdbg -A 12345" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PORT should be given by an option, maybe RUBY_DEBUG_TEST_PORT
or something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test/support/utils.rb
Outdated
inject_lib_to_load_path | ||
|
||
if remote && ENV['RUBY_DEBUG_LOCAL_ONLY_MODE'] == 'false' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RUBY_DEBUG_TEST
prefix is better to make clear the purpose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
32432b2
to
e91ef1e
Compare
e91ef1e
to
7733fd7
Compare
7733fd7
to
ea3f471
Compare
@st0012 |
@ono-max yes. thanks for the quick update 👍 |
I implement the test framework for remote debugger.
remote: false
indebug_code
method when usingrequire "debug/run"
orDEBUGGER__.console
.