Sha256: b28a8f43c5b5490a24976c0f86d988320278a9993afb756e594e499d44e78a61

Contents?: true

Size: 944 Bytes

Versions: 1

Compression:

Stored size: 944 Bytes

Contents

#!/usr/bin/env ruby
require 'test/unit'
require 'rubygems'; require 'require_relative'
require_relative 'helper'

class TestTrace < Test::Unit::TestCase
  include TestHelper
  TREPAN_LOC    = /.. \(.+:\d+( @\d+)?\)/
  def test_trepan_trace
    common_setup(__FILE__)
    Dir.chdir(@srcdir) do 
      last_line = nil
      filter = Proc.new{|got_lines, correct_lines|
        got_lines.each_with_index do |line, i|
          line.gsub!(/\((?:.*\/)?(.+:\d+)/, '(\1') if line =~ TREPAN_LOC
          if line.start_with?('at_exit')
            last_line = i-2
            break
          end
        end
        got_lines[last_line..-1] = got_lines[last_line] if last_line
      }
      rightfile = File.join(%W(.. data #{@testname}))
      assert_equal(true, run_debugger(@testname, 
                                      "-x #{@prefix}../example/gcd.rb 3 5", 
                                      nil, filter, nil, rightfile))
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rb8-trepanning-0.1.4 test/integration/test-trace.rb