зеркало из https://github.com/github/ruby.git
bootstraptest/runner: run in parallel if in parallel build
This commit is contained in:
Родитель
5a8aaedaff
Коммит
942066713b
|
@ -101,8 +101,7 @@ BT = Class.new(bt) do
|
|||
end
|
||||
|
||||
def wn=(wn)
|
||||
if wn <= 0
|
||||
wn = nil
|
||||
unless wn == 1
|
||||
if /(?:\A|\s)--jobserver-(?:auth|fds)=\K(\d+),(\d+)/ =~ ENV.delete("MAKEFLAGS")
|
||||
begin
|
||||
r = IO.for_fd($1.to_i(10), "rb", autoclose: false)
|
||||
|
@ -112,7 +111,7 @@ BT = Class.new(bt) do
|
|||
else
|
||||
r.close_on_exec = true
|
||||
w.close_on_exec = true
|
||||
tokens = r.read_nonblock(1024, exception: false)
|
||||
tokens = r.read_nonblock(wn > 0 ? wn : 1024, exception: false)
|
||||
r.close
|
||||
if String === tokens
|
||||
tokens.freeze
|
||||
|
@ -126,7 +125,7 @@ BT = Class.new(bt) do
|
|||
end
|
||||
end
|
||||
end
|
||||
unless wn
|
||||
if wn <= 0
|
||||
require 'etc'
|
||||
wn = [Etc.nprocessors / 2, 1].max
|
||||
end
|
||||
|
@ -145,7 +144,7 @@ def main
|
|||
BT.color = nil
|
||||
BT.tty = nil
|
||||
BT.quiet = false
|
||||
BT.wn = 1
|
||||
# BT.wn = 1
|
||||
dir = nil
|
||||
quiet = false
|
||||
tests = nil
|
||||
|
@ -216,6 +215,7 @@ End
|
|||
BT.progress = %w[- \\ | /]
|
||||
BT.progress_bs = "\b" * BT.progress[0].size
|
||||
BT.tty = $stderr.tty? if BT.tty.nil?
|
||||
BT.wn ||= /-j(\d+)?/ =~ (ENV["MAKEFLAGS"] || ENV["MFLAGS"]) ? $1.to_i : 1
|
||||
|
||||
case BT.color
|
||||
when nil
|
||||
|
|
Загрузка…
Ссылка в новой задаче