debugger 1.2.4 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +14 -0
- data/.travis.yml +0 -1
- data/CHANGELOG.md +9 -0
- data/Gemfile +3 -0
- data/README.md +2 -0
- data/Rakefile +3 -55
- data/debugger.gemspec +2 -0
- data/lib/debugger/version.rb +1 -1
- data/lib/ruby-debug-base.rb +3 -1
- data/lib/ruby-debug/commands/irb.rb +1 -1
- data/lib/ruby-debug/commands/jump.rb +1 -1
- data/lib/ruby-debug/commands/method.rb +1 -1
- data/lib/ruby-debug/commands/show.rb +1 -1
- data/lib/ruby-debug/commands/trace.rb +2 -2
- data/lib/ruby-debug/commands/variables.rb +3 -3
- data/test/breakpoints_test.rb +365 -0
- data/test/conditions_test.rb +76 -0
- data/test/continue_test.rb +28 -0
- data/test/display_test.rb +141 -0
- data/test/edit_test.rb +55 -0
- data/test/eval_test.rb +92 -0
- data/test/examples/breakpoint1.rb +15 -0
- data/test/examples/breakpoint2.rb +7 -0
- data/test/examples/conditions.rb +4 -0
- data/test/examples/continue.rb +4 -0
- data/test/examples/display.rb +5 -0
- data/test/examples/edit.rb +3 -0
- data/test/examples/edit2.rb +3 -0
- data/test/examples/eval.rb +4 -0
- data/test/examples/finish.rb +20 -0
- data/test/examples/frame.rb +31 -0
- data/test/examples/help.rb +2 -0
- data/test/examples/info.rb +48 -0
- data/test/examples/info2.rb +3 -0
- data/test/examples/irb.rb +6 -0
- data/test/examples/jump.rb +14 -0
- data/test/examples/kill.rb +2 -0
- data/test/examples/list.rb +12 -0
- data/test/examples/method.rb +15 -0
- data/test/examples/post_mortem.rb +19 -0
- data/test/examples/quit.rb +2 -0
- data/test/examples/reload.rb +6 -0
- data/test/examples/restart.rb +6 -0
- data/test/examples/save.rb +3 -0
- data/test/examples/set.rb +3 -0
- data/test/examples/set_annotate.rb +12 -0
- data/test/examples/settings.rb +1 -0
- data/test/examples/show.rb +2 -0
- data/test/examples/source.rb +3 -0
- data/test/examples/stepping.rb +21 -0
- data/test/examples/thread.rb +32 -0
- data/test/examples/tmate.rb +10 -0
- data/test/examples/trace.rb +7 -0
- data/test/examples/trace_threads.rb +20 -0
- data/test/examples/variables.rb +26 -0
- data/test/finish_test.rb +48 -0
- data/test/frame_test.rb +140 -0
- data/test/help_test.rb +50 -0
- data/test/info_test.rb +325 -0
- data/test/irb_test.rb +81 -0
- data/test/jump_test.rb +70 -0
- data/test/kill_test.rb +47 -0
- data/test/list_test.rb +145 -0
- data/test/method_test.rb +70 -0
- data/test/post_mortem_test.rb +25 -0
- data/test/quit_test.rb +55 -0
- data/test/reload_test.rb +43 -0
- data/test/restart_test.rb +143 -0
- data/test/save_test.rb +92 -0
- data/test/set_test.rb +163 -0
- data/test/show_test.rb +292 -0
- data/test/source_test.rb +44 -0
- data/test/stepping_test.rb +118 -0
- data/test/support/breakpoint.rb +12 -0
- data/test/support/context.rb +14 -0
- data/test/support/matchers.rb +67 -0
- data/test/support/mocha_extensions.rb +71 -0
- data/test/support/processor.rb +7 -0
- data/test/support/test_dsl.rb +205 -0
- data/test/support/test_interface.rb +66 -0
- data/test/test_helper.rb +8 -0
- data/test/thread_test.rb +122 -0
- data/test/tmate_test.rb +43 -0
- data/test/trace_test.rb +154 -0
- data/test/variables_test.rb +114 -0
- metadata +107 -158
- data/test/base/base.rb +0 -71
- data/test/base/binding.rb +0 -24
- data/test/base/catchpoint.rb +0 -22
- data/test/base/load.rb +0 -36
- data/test/bp_loop_issue.rb +0 -3
- data/test/classes.rb +0 -11
- data/test/config.yaml +0 -8
- data/test/data/annotate.cmd +0 -29
- data/test/data/annotate.right +0 -139
- data/test/data/break_bad.cmd +0 -18
- data/test/data/break_bad.right +0 -28
- data/test/data/break_loop_bug.cmd +0 -5
- data/test/data/break_loop_bug.right +0 -15
- data/test/data/breakpoints.cmd +0 -38
- data/test/data/breakpoints.right +0 -98
- data/test/data/catch.cmd +0 -20
- data/test/data/catch.right +0 -49
- data/test/data/catch2.cmd +0 -19
- data/test/data/catch2.right +0 -65
- data/test/data/catch3.cmd +0 -11
- data/test/data/catch3.right +0 -37
- data/test/data/condition.cmd +0 -28
- data/test/data/condition.right +0 -65
- data/test/data/ctrl.cmd +0 -23
- data/test/data/ctrl.right +0 -70
- data/test/data/display.cmd +0 -24
- data/test/data/display.right +0 -44
- data/test/data/dollar-0.right +0 -2
- data/test/data/dollar-0a.right +0 -2
- data/test/data/dollar-0b.right +0 -2
- data/test/data/edit.cmd +0 -12
- data/test/data/edit.right +0 -19
- data/test/data/emacs_basic.cmd +0 -43
- data/test/data/emacs_basic.right +0 -106
- data/test/data/enable.cmd +0 -20
- data/test/data/enable.right +0 -36
- data/test/data/finish.cmd +0 -16
- data/test/data/finish.right +0 -31
- data/test/data/frame.cmd +0 -26
- data/test/data/frame.right +0 -55
- data/test/data/help.cmd +0 -20
- data/test/data/help.right +0 -21
- data/test/data/history.right +0 -7
- data/test/data/info-thread.cmd +0 -13
- data/test/data/info-thread.right +0 -37
- data/test/data/info-var-bug2.cmd +0 -5
- data/test/data/info-var-bug2.right +0 -10
- data/test/data/info-var.cmd +0 -23
- data/test/data/info-var.right +0 -52
- data/test/data/info.cmd +0 -21
- data/test/data/info.right +0 -65
- data/test/data/jump.cmd +0 -16
- data/test/data/jump.right +0 -56
- data/test/data/jump2.cmd +0 -16
- data/test/data/jump2.right +0 -44
- data/test/data/linetrace.cmd +0 -6
- data/test/data/linetrace.right +0 -23
- data/test/data/list.cmd +0 -19
- data/test/data/list.right +0 -127
- data/test/data/method.cmd +0 -10
- data/test/data/method.right +0 -21
- data/test/data/methodsig.cmd +0 -10
- data/test/data/methodsig.right +0 -20
- data/test/data/next.cmd +0 -22
- data/test/data/next.right +0 -61
- data/test/data/noquit.right +0 -1
- data/test/data/output.cmd +0 -6
- data/test/data/output.right +0 -31
- data/test/data/pm-bug.cmd +0 -7
- data/test/data/pm-bug.right +0 -12
- data/test/data/post-mortem-next.cmd +0 -8
- data/test/data/post-mortem-next.right +0 -14
- data/test/data/post-mortem-osx.right +0 -31
- data/test/data/post-mortem.cmd +0 -13
- data/test/data/post-mortem.right +0 -32
- data/test/data/quit.cmd +0 -6
- data/test/data/quit.right +0 -0
- data/test/data/raise.cmd +0 -11
- data/test/data/raise.right +0 -23
- data/test/data/save.cmd +0 -34
- data/test/data/save.right +0 -59
- data/test/data/scope-var.cmd +0 -42
- data/test/data/scope-var.right +0 -587
- data/test/data/setshow.cmd +0 -56
- data/test/data/setshow.right +0 -98
- data/test/data/source.cmd +0 -5
- data/test/data/source.right +0 -15
- data/test/data/stepping.cmd +0 -21
- data/test/data/stepping.right +0 -50
- data/test/data/test-init-cygwin.right +0 -7
- data/test/data/test-init-osx.right +0 -4
- data/test/data/test-init.right +0 -5
- data/test/data/trace.right +0 -14
- data/test/dollar-0.rb +0 -5
- data/test/gcd-dbg-nox.rb +0 -30
- data/test/gcd-dbg.rb +0 -29
- data/test/gcd.rb +0 -18
- data/test/helper.rb +0 -142
- data/test/info-var-bug.rb +0 -47
- data/test/info-var-bug2.rb +0 -2
- data/test/jump.rb +0 -14
- data/test/jump2.rb +0 -27
- data/test/lib/commands/catchpoint_test.rb +0 -28
- data/test/lib/commands/unit/regexp.rb +0 -38
- data/test/next.rb +0 -18
- data/test/null.rb +0 -1
- data/test/output.rb +0 -2
- data/test/pm-base.rb +0 -17
- data/test/pm-bug.rb +0 -3
- data/test/pm-catch.rb +0 -12
- data/test/pm-catch2.rb +0 -27
- data/test/pm-catch3.rb +0 -47
- data/test/pm.rb +0 -11
- data/test/raise.rb +0 -3
- data/test/rdebug-save.1 +0 -7
- data/test/runall +0 -12
- data/test/scope-var.rb +0 -29
- data/test/tdebug.rb +0 -246
- data/test/test-annotate.rb +0 -24
- data/test/test-break-bad.rb +0 -36
- data/test/test-breakpoints.rb +0 -24
- data/test/test-catch.rb +0 -24
- data/test/test-catch2.rb +0 -24
- data/test/test-catch3.rb +0 -24
- data/test/test-condition.rb +0 -24
- data/test/test-ctrl.rb +0 -51
- data/test/test-display.rb +0 -25
- data/test/test-dollar-0.rb +0 -39
- data/test/test-edit.rb +0 -25
- data/test/test-emacs-basic.rb +0 -25
- data/test/test-enable.rb +0 -24
- data/test/test-finish.rb +0 -33
- data/test/test-frame.rb +0 -33
- data/test/test-help.rb +0 -54
- data/test/test-hist.rb +0 -65
- data/test/test-info-thread.rb +0 -31
- data/test/test-info-var.rb +0 -46
- data/test/test-info.rb +0 -25
- data/test/test-init.rb +0 -43
- data/test/test-jump.rb +0 -34
- data/test/test-list.rb +0 -24
- data/test/test-method.rb +0 -33
- data/test/test-next.rb +0 -24
- data/test/test-output.rb +0 -25
- data/test/test-quit.rb +0 -29
- data/test/test-raise.rb +0 -24
- data/test/test-remote.rb +0 -14
- data/test/test-save.rb +0 -30
- data/test/test-scope-var.rb +0 -24
- data/test/test-setshow.rb +0 -24
- data/test/test-source.rb +0 -24
- data/test/test-stepping.rb +0 -25
- data/test/test-trace.rb +0 -46
- data/test/thread1.rb +0 -25
- data/test/trunc-call.rb +0 -30
data/test/test-help.rb
DELETED
@@ -1,54 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
# require 'ruby-debug' ; Debugger.start
|
4
|
-
|
5
|
-
require 'test/unit'
|
6
|
-
SRC_DIR = File.dirname(__FILE__) unless
|
7
|
-
defined?(SRC_DIR)
|
8
|
-
require 'ruby_debug'
|
9
|
-
require 'ruby-debug'
|
10
|
-
|
11
|
-
def cheap_diff(got_lines, correct_lines)
|
12
|
-
puts got_lines if $DEBUG
|
13
|
-
correct_lines.each_with_index do |line, i|
|
14
|
-
correct_lines[i].chomp!
|
15
|
-
if got_lines[i] != correct_lines[i]
|
16
|
-
puts "difference found at line #{i+1}"
|
17
|
-
puts "got : #{got_lines[i]}"
|
18
|
-
puts "need: #{correct_lines[i]}"
|
19
|
-
return false
|
20
|
-
end
|
21
|
-
if correct_lines.size != got_lines.size
|
22
|
-
puts("difference in number of lines: " +
|
23
|
-
"#{correct_lines.size} vs. #{got_lines.size}")
|
24
|
-
return false
|
25
|
-
end
|
26
|
-
return true
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
# Test Help commands
|
31
|
-
class TestHelp < Test::Unit::TestCase
|
32
|
-
require 'stringio'
|
33
|
-
|
34
|
-
# Test initial variables and setting/getting state.
|
35
|
-
def test_basic
|
36
|
-
testbase = 'help'
|
37
|
-
op = StringIO.new('', 'w')
|
38
|
-
Dir.chdir(SRC_DIR) do
|
39
|
-
script = File.join('data', "#{testbase}.cmd")
|
40
|
-
Debugger.const_set('Version', 'unit testing')
|
41
|
-
Debugger.run_script(script, op)
|
42
|
-
got_lines = op.string.split("\n")
|
43
|
-
right_file = File.join('data', "#{testbase}.right")
|
44
|
-
correct_lines = File.readlines(right_file)
|
45
|
-
result = cheap_diff(got_lines, correct_lines)
|
46
|
-
unless result
|
47
|
-
puts '-' * 80
|
48
|
-
puts got_lines
|
49
|
-
puts '-' * 80
|
50
|
-
end
|
51
|
-
assert result
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
data/test/test-hist.rb
DELETED
@@ -1,65 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
require 'test/unit'
|
3
|
-
|
4
|
-
# require 'ruby-debug'; Debugger.start
|
5
|
-
|
6
|
-
# Test history commands
|
7
|
-
|
8
|
-
class TestHistory < Test::Unit::TestCase
|
9
|
-
|
10
|
-
@@SRC_DIR = File.join(Dir.pwd, File.dirname(__FILE__)) unless
|
11
|
-
defined?(@@SRC_DIR)
|
12
|
-
|
13
|
-
require File.join(@@SRC_DIR, 'helper')
|
14
|
-
include TestHelper
|
15
|
-
|
16
|
-
unless defined?(@@FILE_HISTORY)
|
17
|
-
@@FILE_HISTORY = '.rdebug_hist'
|
18
|
-
end
|
19
|
-
|
20
|
-
def test_basic
|
21
|
-
|
22
|
-
# Set up history file to read from.
|
23
|
-
ENV['HOME']=@@SRC_DIR
|
24
|
-
ENV['RDEBUG'] = nil
|
25
|
-
|
26
|
-
debugger_commands = ['show commands',
|
27
|
-
'set history save on',
|
28
|
-
'show history',
|
29
|
-
'quit unconditionally']
|
30
|
-
debugger_output = 'test-history.out'
|
31
|
-
|
32
|
-
Dir.chdir(@@SRC_DIR) do
|
33
|
-
correct_lines = File.read(File.join('data', 'history.right')).split(/\n/)
|
34
|
-
f = File.open(@@FILE_HISTORY, 'w')
|
35
|
-
correct_lines[0.. -(debugger_commands.length+1)].each do |line|
|
36
|
-
f.puts line
|
37
|
-
end
|
38
|
-
f.close
|
39
|
-
|
40
|
-
# Now that we've set up a history file, run the debugger
|
41
|
-
# and check that it's reading that correctly.
|
42
|
-
debug_pgm=File.join('..', 'rdbg.rb')
|
43
|
-
debugged=File.join('gcd.rb')
|
44
|
-
IO.popen("#{debug_pgm} #{debugged} 3 5 >#{debugger_output}", 'w') do
|
45
|
-
|pipe|
|
46
|
-
debugger_commands.each do |cmd|
|
47
|
-
pipe.puts cmd
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
# Compare output
|
52
|
-
got_lines = File.read(@@FILE_HISTORY).split(/\n/)
|
53
|
-
# FIXME: Disable for now.
|
54
|
-
assert true, 'FIXME'
|
55
|
-
return
|
56
|
-
if cheap_diff(got_lines, correct_lines)
|
57
|
-
assert true
|
58
|
-
FileUtils.rm(debugger_output)
|
59
|
-
FileUtils.rm(@@FILE_HISTORY)
|
60
|
-
else
|
61
|
-
assert nil, 'Output differs'
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
data/test/test-info-thread.rb
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
require 'test/unit'
|
3
|
-
|
4
|
-
# require 'ruby-debug'; Debugger.start
|
5
|
-
|
6
|
-
# Test simple thread commands
|
7
|
-
class TestInfoThread < Test::Unit::TestCase
|
8
|
-
|
9
|
-
@@SRC_DIR = File.join(Dir.pwd, File.dirname(__FILE__)) unless
|
10
|
-
defined?(@@SRC_DIR)
|
11
|
-
|
12
|
-
require File.join(@@SRC_DIR, 'helper')
|
13
|
-
include TestHelper
|
14
|
-
|
15
|
-
def test_basic
|
16
|
-
testname='info-thread'
|
17
|
-
Dir.chdir(@@SRC_DIR) do
|
18
|
-
filter = Proc.new{|got_lines, correct_lines|
|
19
|
-
[got_lines, correct_lines].each do |a|
|
20
|
-
a.each do |s|
|
21
|
-
s.sub!(/Thread:0x[0-9a-f]+/, 'Thread:0x12345678')
|
22
|
-
end
|
23
|
-
end
|
24
|
-
}
|
25
|
-
script = File.join('data', testname + '.cmd')
|
26
|
-
assert_equal(true,
|
27
|
-
run_debugger(testname,
|
28
|
-
"--script #{script} -- ./gcd.rb 3 5", nil, filter))
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
data/test/test-info-var.rb
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
require 'test/unit'
|
3
|
-
|
4
|
-
# require 'ruby-debug'; Debugger.start
|
5
|
-
|
6
|
-
# Test info variables command
|
7
|
-
class TestInfoVar < Test::Unit::TestCase
|
8
|
-
|
9
|
-
@@SRC_DIR = File.join(Dir.pwd, File.dirname(__FILE__)) unless
|
10
|
-
defined?(@@SRC_DIR)
|
11
|
-
|
12
|
-
require File.join(@@SRC_DIR, 'helper')
|
13
|
-
include TestHelper
|
14
|
-
|
15
|
-
def test_info_variables
|
16
|
-
|
17
|
-
Dir.chdir(@@SRC_DIR) do
|
18
|
-
|
19
|
-
filter = Proc.new{|got_lines, correct_lines|
|
20
|
-
[got_lines[13-1], correct_lines[13-1]].each do |s|
|
21
|
-
s.sub!(/Mine:0x[0-9,a-f]+/, 'Mine:')
|
22
|
-
end
|
23
|
-
[got_lines, correct_lines].each do |a|
|
24
|
-
a.each do |s|
|
25
|
-
s.sub!(/Lousy_inspect:0x[0-9,a-f]+/, 'Lousy_inspect:')
|
26
|
-
s.sub!(/UnsuspectingClass:0x[0-9,a-f]+/, 'UnsuspectingClass:')
|
27
|
-
end
|
28
|
-
end
|
29
|
-
}
|
30
|
-
|
31
|
-
testname='info-var'
|
32
|
-
script = File.join('data', testname + '.cmd')
|
33
|
-
assert_equal(true,
|
34
|
-
run_debugger(testname,
|
35
|
-
"--script #{script} -- ./info-var-bug.rb",
|
36
|
-
nil, filter))
|
37
|
-
testname='info-var-bug2'
|
38
|
-
script = File.join('data', testname + '.cmd')
|
39
|
-
assert_equal(true,
|
40
|
-
run_debugger(testname,
|
41
|
-
"--script #{script} -- ./info-var-bug2.rb",
|
42
|
-
nil))
|
43
|
-
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
data/test/test-info.rb
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
require 'test/unit'
|
3
|
-
|
4
|
-
# require 'ruby-debug'; Debugger.start
|
5
|
-
|
6
|
-
# Test info commands
|
7
|
-
class TestInfo < Test::Unit::TestCase
|
8
|
-
|
9
|
-
@@SRC_DIR = File.join(Dir.pwd, File.dirname(__FILE__)) unless
|
10
|
-
defined?(@@SRC_DIR)
|
11
|
-
|
12
|
-
require File.join(@@SRC_DIR, 'helper')
|
13
|
-
include TestHelper
|
14
|
-
|
15
|
-
# Test commands in info.rb
|
16
|
-
def test_basic
|
17
|
-
testname='info'
|
18
|
-
Dir.chdir(@@SRC_DIR) do
|
19
|
-
script = File.join('data', testname + '.cmd')
|
20
|
-
assert_equal(true,
|
21
|
-
run_debugger(testname,
|
22
|
-
"--script #{script} -- ./gcd.rb 3 5"))
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
data/test/test-init.rb
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
require 'test/unit'
|
3
|
-
require 'rbconfig'
|
4
|
-
|
5
|
-
# require 'ruby-debug'; Debugger.start
|
6
|
-
|
7
|
-
# Test Debugger.init and setting up ruby-debug variables
|
8
|
-
class TestDebuggerInit < Test::Unit::TestCase
|
9
|
-
@@SRC_DIR = File.join(Dir.pwd, File.dirname(__FILE__)) unless
|
10
|
-
defined?(@@SRC_DIR)
|
11
|
-
require File.join(@@SRC_DIR, 'helper')
|
12
|
-
|
13
|
-
def test_basic
|
14
|
-
debugger_output = 'test-init.out'
|
15
|
-
Dir.chdir(@@SRC_DIR) do
|
16
|
-
old_emacs = ENV['EMACS']
|
17
|
-
old_columns = ENV['COLUMNS']
|
18
|
-
ENV['EMACS'] = nil
|
19
|
-
ENV['COLUMNS'] = '120'
|
20
|
-
ruby = "#{TestHelper.load_ruby} #{TestHelper.load_params}"
|
21
|
-
IO.popen("#{ruby} ./gcd-dbg.rb 5 >#{debugger_output}", 'w') do |pipe|
|
22
|
-
pipe.puts 'p Debugger::PROG_SCRIPT'
|
23
|
-
pipe.puts 'show args'
|
24
|
-
pipe.puts 'quit unconditionally'
|
25
|
-
end
|
26
|
-
lines = File.open(debugger_output).readlines
|
27
|
-
ENV['EMACS'] = old_emacs
|
28
|
-
ENV['COLUMNS'] = old_columns
|
29
|
-
|
30
|
-
right_file = case Config::CONFIG['host_os']
|
31
|
-
when /^darwin/
|
32
|
-
'test-init-osx.right'
|
33
|
-
when /^cygwin/
|
34
|
-
'test-init-cygwin.right'
|
35
|
-
else
|
36
|
-
'test-init.right'
|
37
|
-
end
|
38
|
-
expected = File.open(File.join('data', right_file)).readlines
|
39
|
-
assert_equal(expected, lines)
|
40
|
-
File.delete(debugger_output) if expected == lines
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
data/test/test-jump.rb
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
require 'test/unit'
|
3
|
-
|
4
|
-
# require 'ruby-debug'; Debugger.start
|
5
|
-
|
6
|
-
# Test jump command
|
7
|
-
class TestJumpCommand < Test::Unit::TestCase
|
8
|
-
|
9
|
-
@@SRC_DIR = File.join(Dir.pwd, File.dirname(__FILE__)) unless
|
10
|
-
defined?(@@SRC_DIR)
|
11
|
-
|
12
|
-
require File.join(@@SRC_DIR, 'helper')
|
13
|
-
include TestHelper
|
14
|
-
|
15
|
-
def test_basic
|
16
|
-
testname='jump'
|
17
|
-
Dir.chdir(@@SRC_DIR) do
|
18
|
-
script = File.join('data', testname + '.cmd')
|
19
|
-
assert_equal(true,
|
20
|
-
run_debugger(testname,
|
21
|
-
"--script #{script} -- ./#{testname}.rb"))
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
def test_basic_2
|
26
|
-
testname='jump2'
|
27
|
-
Dir.chdir(@@SRC_DIR) do
|
28
|
-
script = File.join('data', testname + '.cmd')
|
29
|
-
assert_equal(true,
|
30
|
-
run_debugger(testname,
|
31
|
-
"--script #{script} -- ./#{testname}.rb"))
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
data/test/test-list.rb
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
require 'test/unit'
|
3
|
-
|
4
|
-
# require 'ruby-debug'; Debugger.start
|
5
|
-
|
6
|
-
# Test List commands
|
7
|
-
class TestList < Test::Unit::TestCase
|
8
|
-
|
9
|
-
@@src_dir = File.join(Dir.pwd, File.dirname(__FILE__))
|
10
|
-
|
11
|
-
require File.join(@@src_dir, 'helper')
|
12
|
-
include TestHelper
|
13
|
-
|
14
|
-
# Test commands in list.rb
|
15
|
-
def test_basic
|
16
|
-
testname='list'
|
17
|
-
Dir.chdir(@@src_dir) do
|
18
|
-
script = File.join('data', testname + '.cmd')
|
19
|
-
assert_equal(true,
|
20
|
-
run_debugger(testname,
|
21
|
-
"--script #{script} -- ./gcd.rb 3 5"))
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
data/test/test-method.rb
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
require 'test/unit'
|
3
|
-
|
4
|
-
# require 'ruby-debug'; Debugger.start(:post_mortem => true)
|
5
|
-
|
6
|
-
class TestMethod < Test::Unit::TestCase
|
7
|
-
|
8
|
-
@@SRC_DIR = File.join(Dir.pwd, File.dirname(__FILE__)) unless
|
9
|
-
defined?(@@SRC_DIR)
|
10
|
-
|
11
|
-
require File.join(@@SRC_DIR, 'helper')
|
12
|
-
include TestHelper
|
13
|
-
|
14
|
-
def test_basic
|
15
|
-
testname='method'
|
16
|
-
Dir.chdir(@@SRC_DIR) do
|
17
|
-
script = File.join('data', testname + '.cmd')
|
18
|
-
assert_equal(true,
|
19
|
-
run_debugger(testname,
|
20
|
-
"--script #{script} -- ./classes.rb"))
|
21
|
-
begin
|
22
|
-
require 'methodsig'
|
23
|
-
testname='methodsig'
|
24
|
-
script = File.join('data', testname + '.cmd')
|
25
|
-
assert_equal(true,
|
26
|
-
run_debugger(testname,
|
27
|
-
"--script #{script} -- ./classes.rb"))
|
28
|
-
rescue LoadError
|
29
|
-
puts "Skipping method sig test"
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
data/test/test-next.rb
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
require 'test/unit'
|
3
|
-
|
4
|
-
# require 'ruby-debug'; Debugger.start
|
5
|
-
|
6
|
-
# Test next command
|
7
|
-
class TestNextCommand < Test::Unit::TestCase
|
8
|
-
|
9
|
-
@@SRC_DIR = File.join(Dir.pwd, File.dirname(__FILE__)) unless
|
10
|
-
defined?(@@SRC_DIR)
|
11
|
-
|
12
|
-
require File.join(@@SRC_DIR, 'helper')
|
13
|
-
include TestHelper
|
14
|
-
|
15
|
-
def test_basic
|
16
|
-
testname='next'
|
17
|
-
Dir.chdir(@@SRC_DIR) do
|
18
|
-
script = File.join('data', testname + '.cmd')
|
19
|
-
assert_equal(true,
|
20
|
-
run_debugger(testname,
|
21
|
-
"--script #{script} -- ./#{testname}.rb"))
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
data/test/test-output.rb
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
require 'test/unit'
|
3
|
-
|
4
|
-
# require 'ruby-debug'; Debugger.start
|
5
|
-
|
6
|
-
# Test 'starting' annotation.
|
7
|
-
class TestStartingAnnotate < Test::Unit::TestCase
|
8
|
-
|
9
|
-
@@SRC_DIR = File.join(Dir.pwd, File.dirname(__FILE__)) unless
|
10
|
-
defined?(@@SRC_DIR)
|
11
|
-
|
12
|
-
require File.join(@@SRC_DIR, 'helper')
|
13
|
-
include TestHelper
|
14
|
-
|
15
|
-
def test_basic
|
16
|
-
testname='output'
|
17
|
-
Dir.chdir(@@SRC_DIR) do
|
18
|
-
script = File.join('data', testname + '.cmd')
|
19
|
-
assert_equal(true,
|
20
|
-
run_debugger(testname,
|
21
|
-
"-A 3 --script #{script} -- ./output.rb",
|
22
|
-
nil, nil, true))
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
data/test/test-quit.rb
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
require 'test/unit'
|
3
|
-
|
4
|
-
# require 'ruby-debug'; Debugger.start
|
5
|
-
|
6
|
-
# Test Quit command
|
7
|
-
class TestQuit < Test::Unit::TestCase
|
8
|
-
|
9
|
-
@@SRC_DIR = File.join(Dir.pwd, File.dirname(__FILE__)) unless
|
10
|
-
defined?(@@SRC_DIR)
|
11
|
-
|
12
|
-
require File.join(@@SRC_DIR, 'helper')
|
13
|
-
include TestHelper
|
14
|
-
|
15
|
-
def test_basic
|
16
|
-
testname='quit'
|
17
|
-
Dir.chdir(@@SRC_DIR) do
|
18
|
-
script = File.join('data', testname + '.cmd')
|
19
|
-
# filter = Proc.new{|got_lines, correct_lines|
|
20
|
-
# [got_lines[0], correct_lines[0]].each do |s|
|
21
|
-
# s.sub!(/tdebug.rb:\d+/, 'rdebug:999')
|
22
|
-
# end
|
23
|
-
# }
|
24
|
-
assert_equal(true,
|
25
|
-
run_debugger(testname,
|
26
|
-
"--script #{script} -- ./null.rb"))
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|