From cec61d16d2fb50812a003338a719f186a6bd88ef Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sun, 10 Oct 2021 19:23:52 +0900 Subject: [PATCH] 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 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 end class Alpha < NoSort + include JITFirst + def sort_by_name(list) list.sort_by(&:name) end @@ -89,6 +97,8 @@ module Test # 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 list.sort_by {|e| randomize_key(e)} end - def group(list) - list - end - private def crc32(str, crc32 = 0xffffffff)