method
run
v2_1_10 -
Show latest stable
-
0 notes -
Class: Worker
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125 (0)
- 1_9_3_392 (0)
- 2_1_10 (0)
- 2_2_9
- 2_4_6
- 2_5_5
- 2_6_3
- What's this?
run(args = [])
public
Hide source
# File lib/test/unit/parallel.rb, line 84 def run(args = []) # :nodoc: process_args args @@stop_auto_run = true @opts = @options.dup @need_exit = false @old_loadpath = [] begin begin @stdout = increment_io(STDOUT) @stdin = increment_io(STDIN) rescue exit 2 end exit 2 unless @stdout && @stdin @stdout.sync = true _report "ready!" while buf = @stdin.gets case buf.chomp when /^loadpath (.+?)$/ @old_loadpath = $:.dup $:.push(*Marshal.load($1.unpack("m")[0].force_encoding("ASCII-8BIT"))).uniq! when /^run (.+?) (.+?)$/ _report "okay" @options = @opts.dup suites = MiniTest::Unit::TestCase.test_suites begin require $1 rescue LoadError _report "after", Marshal.dump([$1, ProxyError.new($!)]) _report "ready" next end _run_suites MiniTest::Unit::TestCase.test_suites-suites, $2.to_sym if @need_exit begin _report "bye" rescue Errno::EPIPE; end exit else _report "ready" end when /^quit$/ begin _report "bye" rescue Errno::EPIPE; end exit end end rescue Errno::EPIPE rescue Exception => e begin trace = e.backtrace err = ["#{trace.shift}: #{e.message} (#{e.class})"] + trace.map{|t| t.prepend("\t") } _report "bye", Marshal.dump(err.join("\n")) rescue Errno::EPIPE;end exit ensure @stdin.close if @stdin @stdout.close if @stdout end end