Skip to content

Commit e01e13c

Browse files
committed
Use assert_ruby_status if no assertion
1 parent fc0c67d commit e01e13c

18 files changed

+35
-29
lines changed

test/-ext-/tracepoint/test_tracepoint.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def run(hook)
8383
end
8484

8585
def test_teardown_with_active_GC_end_hook
86-
assert_separately([], 'require("-test-/tracepoint"); Bug.after_gc_exit_hook = proc {}; GC.start')
86+
assert_ruby_status([], 'require("-test-/tracepoint"); Bug.after_gc_exit_hook = proc {}; GC.start')
8787
end
8888

8989
end

test/objspace/test_objspace.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def test_reachable_objects_from
143143
def test_reachable_objects_during_iteration
144144
omit 'flaky on Visual Studio with: [BUG] Unnormalized Fixnum value' if /mswin/ =~ RUBY_PLATFORM
145145
opts = %w[--disable-gem --disable=frozen-string-literal -robjspace]
146-
assert_separately opts, "#{<<-"begin;"}\n#{<<-'end;'}"
146+
assert_ruby_status opts, "#{<<-"begin;"}\n#{<<-'end;'}"
147147
begin;
148148
ObjectSpace.each_object{|o|
149149
o.inspect
@@ -179,7 +179,7 @@ def test_reachable_objects_size
179179
end
180180

181181
def test_trace_object_allocations_stop_first
182-
assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}")
182+
assert_ruby_status([], "#{<<~"begin;"}\n#{<<~'end;'}")
183183
begin;
184184
require "objspace"
185185
# Make sure stopping before the tracepoints are initialized doesn't raise. See [Bug #17020]

test/openssl/test_fips.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def test_fips_mode_get_is_false_on_fips_mode_disabled
3030
def test_fips_mode_is_reentrant
3131
return if aws_lc? # AWS-LC's FIPS mode is decided at compile time.
3232

33-
assert_separately(["-ropenssl"], <<~"end;")
33+
assert_ruby_status(["-ropenssl"], <<~"end;")
3434
OpenSSL.fips_mode = false
3535
OpenSSL.fips_mode = false
3636
end;

test/ripper/assert_parse_files.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class Parser < Ripper
4040
end
4141
}
4242
end
43+
assert(true) if scripts.empty?
4344
end;
4445
end
4546
end

test/ruby/test_autoload.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ def test_autoload_parallel_race
574574
autoload_path = File.join(tmpdir, "autoload_parallel_race.rb")
575575
File.write(autoload_path, 'module Foo; end; module Bar; end')
576576

577-
assert_separately([], <<-RUBY, timeout: 100)
577+
assert_ruby_status([], <<-RUBY, timeout: 100)
578578
autoload_path = #{File.realpath(autoload_path).inspect}
579579
580580
# This should work with no errors or failures.
@@ -617,6 +617,10 @@ module SomeNamespace
617617
private
618618

619619
def assert_separately(*args, **kwargs)
620-
super(*args, **{ timeout: 60 }.merge(kwargs))
620+
super(*args, timeout: 60, **kwargs)
621+
end
622+
623+
def assert_ruby_status(*args, **kwargs)
624+
super(*args, timeout: 60, **kwargs)
621625
end
622626
end

test/ruby/test_gc_compact.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ def add_ivars
364364
def test_compact_objects_of_varying_sizes
365365
omit if GC::INTERNAL_CONSTANTS[:SIZE_POOL_COUNT] == 1
366366

367-
assert_separately([], "#{<<~"begin;"}\n#{<<~"end;"}", timeout: 10)
367+
assert_ruby_status([], "#{<<~"begin;"}\n#{<<~"end;"}", timeout: 10)
368368
begin;
369369
$objects = []
370370
160.times do |n|

test/ruby/test_lambda.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def self.b
163163
end
164164

165165
def test_proc_inside_lambda_toplevel
166-
assert_separately [], <<~RUBY
166+
assert_ruby_status [], <<~RUBY
167167
lambda{
168168
$g = proc{ return :pr }
169169
}.call

test/ruby/test_module.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ def b; 2 end
583583
end
584584

585585
def test_gc_prepend_chain
586-
assert_separately([], <<-EOS)
586+
assert_ruby_status([], <<-EOS)
587587
10000.times { |i|
588588
m1 = Module.new do
589589
def foo; end
@@ -3073,7 +3073,7 @@ def test_return_value_of_define_singleton_method
30733073
end
30743074

30753075
def test_prepend_gc
3076-
assert_separately [], %{
3076+
assert_ruby_status [], %{
30773077
module Foo
30783078
end
30793079
class Object

test/ruby/test_optimization.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -946,14 +946,14 @@ def foo &b
946946
end
947947

948948
def test_peephole_optimization_without_trace
949-
assert_separately [], <<-END
949+
assert_ruby_status [], <<-END
950950
RubyVM::InstructionSequence.compile_option = {trace_instruction: false}
951951
eval "def foo; 1.times{|(a), &b| nil && a}; end"
952952
END
953953
end
954954

955955
def test_clear_unreachable_keyword_args
956-
assert_separately [], <<-END, timeout: 60
956+
assert_ruby_status [], <<-END, timeout: 60
957957
script = <<-EOS
958958
if true
959959
else

test/ruby/test_process.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1996,7 +1996,7 @@ def test_popen_exit
19961996
end
19971997

19981998
def test_popen_reopen
1999-
assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}")
1999+
assert_ruby_status([], "#{<<~"begin;"}\n#{<<~'end;'}")
20002000
begin;
20012001
io = File.open(IO::NULL)
20022002
io2 = io.dup
@@ -2387,7 +2387,7 @@ def test_clock_getres_MACH_ABSOLUTE_TIME_BASED_CLOCK_MONOTONIC
23872387
end
23882388

23892389
def test_deadlock_by_signal_at_forking
2390-
assert_separately(%W(- #{RUBY}), <<-INPUT, timeout: 100)
2390+
assert_ruby_status(%W(- #{RUBY}), <<-INPUT, timeout: 100)
23912391
ruby = ARGV.shift
23922392
GC.start # reduce garbage
23932393
GC.disable # avoid triggering CoW after forks

0 commit comments

Comments
 (0)