diff options
author | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-06-29 14:35:09 +0000 |
---|---|---|
committer | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-06-29 14:35:09 +0000 |
commit | d55cd34ba8680310fb07c2f5c1c6a27b4902865d (patch) | |
tree | abc35065c29846042d84e71b6bf500df5cd76d68 /spec/mspec/lib/mspec/commands | |
parent | 0a11abfc7ec92fcf4eb9e973c68588f079fdb60d (diff) |
Update to ruby/mspec@021a119
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/mspec/lib/mspec/commands')
-rwxr-xr-x | spec/mspec/lib/mspec/commands/mspec.rb | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/spec/mspec/lib/mspec/commands/mspec.rb b/spec/mspec/lib/mspec/commands/mspec.rb index d3edb4d51e..cb1c0fbacb 100755 --- a/spec/mspec/lib/mspec/commands/mspec.rb +++ b/spec/mspec/lib/mspec/commands/mspec.rb @@ -114,6 +114,7 @@ class MSpecMain < MSpecScript puts children.map { |child| child.gets }.uniq formatter.start + last_files = {} until @files.empty? IO.select(children)[0].each { |io| @@ -127,22 +128,33 @@ class MSpecMain < MSpecScript while chunk = (io.read_nonblock(4096) rescue nil) reply += chunk end - raise reply + reply.chomp!('.') + msg = "A child mspec-run process printed unexpected output on STDOUT" + if last_file = last_files[io] + msg += " while running #{last_file}" + end + abort "\n#{msg}: #{reply.inspect}" + end + + unless @files.empty? + file = @files.shift + last_files[io] = file + io.puts file end - io.puts @files.shift unless @files.empty? } end - ok = true + success = true children.each { |child| child.puts "QUIT" - Process.wait(child.pid) - ok &&= $?.success? + _pid, status = Process.wait2(child.pid) + success &&= status.success? + child.close } formatter.aggregate_results(output_files) formatter.finish - ok + success end def run @@ -152,7 +164,7 @@ class MSpecMain < MSpecScript argv.concat config[:flags] argv.concat config[:loadpath] argv.concat config[:requires] - argv << "#{MSPEC_HOME}/bin/mspec-#{ config[:command] || "run" }" + argv << "#{MSPEC_HOME}/bin/mspec-#{config[:command] || 'run'}" argv.concat config[:options] if config[:multi] |