зеркало из 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
|
end
|
||||||
|
|
||||||
def wn=(wn)
|
def wn=(wn)
|
||||||
if wn <= 0
|
unless wn == 1
|
||||||
wn = nil
|
|
||||||
if /(?:\A|\s)--jobserver-(?:auth|fds)=\K(\d+),(\d+)/ =~ ENV.delete("MAKEFLAGS")
|
if /(?:\A|\s)--jobserver-(?:auth|fds)=\K(\d+),(\d+)/ =~ ENV.delete("MAKEFLAGS")
|
||||||
begin
|
begin
|
||||||
r = IO.for_fd($1.to_i(10), "rb", autoclose: false)
|
r = IO.for_fd($1.to_i(10), "rb", autoclose: false)
|
||||||
|
@ -112,7 +111,7 @@ BT = Class.new(bt) do
|
||||||
else
|
else
|
||||||
r.close_on_exec = true
|
r.close_on_exec = true
|
||||||
w.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
|
r.close
|
||||||
if String === tokens
|
if String === tokens
|
||||||
tokens.freeze
|
tokens.freeze
|
||||||
|
@ -126,7 +125,7 @@ BT = Class.new(bt) do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
unless wn
|
if wn <= 0
|
||||||
require 'etc'
|
require 'etc'
|
||||||
wn = [Etc.nprocessors / 2, 1].max
|
wn = [Etc.nprocessors / 2, 1].max
|
||||||
end
|
end
|
||||||
|
@ -145,7 +144,7 @@ def main
|
||||||
BT.color = nil
|
BT.color = nil
|
||||||
BT.tty = nil
|
BT.tty = nil
|
||||||
BT.quiet = false
|
BT.quiet = false
|
||||||
BT.wn = 1
|
# BT.wn = 1
|
||||||
dir = nil
|
dir = nil
|
||||||
quiet = false
|
quiet = false
|
||||||
tests = nil
|
tests = nil
|
||||||
|
@ -216,6 +215,7 @@ End
|
||||||
BT.progress = %w[- \\ | /]
|
BT.progress = %w[- \\ | /]
|
||||||
BT.progress_bs = "\b" * BT.progress[0].size
|
BT.progress_bs = "\b" * BT.progress[0].size
|
||||||
BT.tty = $stderr.tty? if BT.tty.nil?
|
BT.tty = $stderr.tty? if BT.tty.nil?
|
||||||
|
BT.wn ||= /-j(\d+)?/ =~ (ENV["MAKEFLAGS"] || ENV["MFLAGS"]) ? $1.to_i : 1
|
||||||
|
|
||||||
case BT.color
|
case BT.color
|
||||||
when nil
|
when nil
|
||||||
|
|
Загрузка…
Ссылка в новой задаче