class TestRunner::Runner::ProcessSet::Process
Attributes
fd[R]
file[R]
pid[R]
Public Class Methods
new(file)
click to toggle source
# File lib/test_runner/runner.rb, line 102 def initialize file @file = file end
Public Instance Methods
finish()
click to toggle source
# File lib/test_runner/runner.rb, line 136 def finish fd.read 1 _, status = ::Process.wait2 pid status = status.exitstatus Config.internal_logger.debug "finished script #{@file}; status=#{status.inspect}" status == 0 end
print_stacktrace(error)
click to toggle source
# File lib/test_runner/runner.rb, line 124 def print_stacktrace error locations = error.backtrace final_location = locations.shift locations = TestRunner::BacktraceFilter.(locations) lines = locations.map do |loc| "\tfrom #{loc}" end lines.unshift "#{final_location}: #{error.message} (#{error.class.name})" lines.reverse! if Config.reverse_backtraces Config.logger.error "Exception:\n#{lines * "\n"}" end
start()
click to toggle source
# File lib/test_runner/runner.rb, line 106 def start @fd, wr = IO.pipe @pid = fork do @fd.close begin load file rescue => error print_stacktrace error exit 1 ensure wr.write "\x00" end end freeze end