|
33 | 33 | next if bundled_gems&.none? {|pat| File.fnmatch?(pat, gem)} |
34 | 34 | next unless File.directory?("#{gem_dir}/src/#{gem}/test") |
35 | 35 |
|
36 | | - test_command = "#{ruby} -C #{gem_dir}/src/#{gem} #{rake} test" |
| 36 | + test_command = [ruby, "-C", "#{gem_dir}/src/#{gem}", rake, "test"] |
37 | 37 | first_timeout = 600 # 10min |
38 | 38 |
|
39 | 39 | toplib = gem |
|
61 | 61 | rbs_skip_tests << File.join(__dir__, "/rbs_skip_tests_windows") |
62 | 62 | end |
63 | 63 |
|
64 | | - test_command << " stdlib_test validate RBS_SKIP_TESTS=#{rbs_skip_tests.join(File::PATH_SEPARATOR)} SKIP_RBS_VALIDATION=true" |
| 64 | + test_command.concat %W[stdlib_test validate RBS_SKIP_TESTS=#{rbs_skip_tests.join(File::PATH_SEPARATOR)} SKIP_RBS_VALIDATION=true] |
65 | 65 | first_timeout *= 3 |
66 | 66 |
|
67 | 67 | when "debug" |
|
71 | 71 | load_path = true |
72 | 72 |
|
73 | 73 | when "test-unit" |
74 | | - test_command = "#{ruby} -C #{gem_dir}/src/#{gem} test/run.rb" |
| 74 | + test_command = [ruby, "-C", "#{gem_dir}/src/#{gem}", "test/run.rb"] |
75 | 75 |
|
76 | 76 | when "win32ole" |
77 | 77 | next unless /mswin|mingw/ =~ RUBY_PLATFORM |
|
89 | 89 | # 93(bright yellow) is copied from .github/workflows/mingw.yml |
90 | 90 | puts "#{github_actions ? "::group::\e\[93m" : "\n"}Testing the #{gem} gem#{github_actions ? "\e\[m" : ""}" |
91 | 91 | print "[command]" if github_actions |
92 | | - puts test_command |
| 92 | + p test_command |
93 | 93 | timeouts = {nil => first_timeout, INT: 30, TERM: 10, KILL: nil} |
94 | 94 | if /mingw|mswin/ =~ RUBY_PLATFORM |
95 | 95 | timeouts.delete(:TERM) # Inner process signal on Windows |
96 | | - timeouts.delete(:INT) # root process will be terminated too |
97 | 96 | group = :new_pgroup |
98 | 97 | pg = "" |
99 | 98 | else |
100 | 99 | group = :pgroup |
101 | 100 | pg = "-" |
102 | 101 | end |
103 | | - pid = Process.spawn(test_command, group => true) |
| 102 | + pid = Process.spawn(*test_command, group => true) |
104 | 103 | timeouts.each do |sig, sec| |
105 | 104 | if sig |
106 | 105 | puts "Sending #{sig} signal" |
|
0 commit comments