ruby-changes:68350
From: Nobuyoshi <ko1@a...>
Date: Sun, 10 Oct 2021 19:35:48 +0900 (JST)
Subject: [ruby-changes:68350] cec61d16d2 (master): Run JIT tests first when random order instead of no-sort
https://git.ruby-lang.org/ruby.git/commit/?id=cec61d16d2 From cec61d16d2fb50812a003338a719f186a6bd88ef Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Sun, 10 Oct 2021 19:23:52 +0900 Subject: Run JIT tests first when random order instead of no-sort --- tool/lib/test/unit.rb | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tool/lib/test/unit.rb b/tool/lib/test/unit.rb index 9671df1ad4..15e290e5f1 100644 --- a/tool/lib/test/unit.rb +++ b/tool/lib/test/unit.rb @@ -69,6 +69,12 @@ module Test https://github.com/ruby/ruby/blob/trunk/tool/lib/test/unit.rb#L69 alias sort_by_string sort_by_name + def group(list) + list + end + end + + module JITFirst def group(list) # JIT first jit, others = list.partition {|e| /test_jit/ =~ e} @@ -77,6 +83,8 @@ module Test https://github.com/ruby/ruby/blob/trunk/tool/lib/test/unit.rb#L83 end class Alpha < NoSort + include JITFirst + def sort_by_name(list) list.sort_by(&:name) end @@ -89,6 +97,8 @@ module Test https://github.com/ruby/ruby/blob/trunk/tool/lib/test/unit.rb#L97 # shuffle test suites based on CRC32 of their names Shuffle = Struct.new(:seed, :salt) do + include JITFirst + def initialize(seed) self.class::CRC_TBL ||= (0..255).map {|i| (0..7).inject(i) {|c,| (c & 1 == 1) ? (0xEDB88320 ^ (c >> 1)) : (c >> 1) } @@ -106,10 +116,6 @@ module Test https://github.com/ruby/ruby/blob/trunk/tool/lib/test/unit.rb#L116 list.sort_by {|e| randomize_key(e)} end - def group(list) - list - end - private def crc32(str, crc32 = 0xffffffff) -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/