summaryrefslogtreecommitdiff
path: root/test/lib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-27 08:02:20 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-27 08:02:20 +0000
commit2df5bb9ac14426a707a05d61db1b5ce8dd0fd52d (patch)
treee7dd06ef8d676ecdc134af520c70c475a7b8bbc7 /test/lib
parentb38b920ae5d34d5bb34ab3be2171922e0fe947a6 (diff)
envutil.rb: EnvUtil.gc_stress_to_class
* test/lib/envutil.rb (EnvUtil.gc_stress_to_class): check if GC.stress_to_class is available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/lib')
-rw-r--r--test/lib/envutil.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/lib/envutil.rb b/test/lib/envutil.rb
index dc94a8f..eb40272 100644
--- a/test/lib/envutil.rb
+++ b/test/lib/envutil.rb
@@ -238,6 +238,14 @@ module EnvUtil
def self.diagnostic_reports(signame, cmd, pid, now)
end
end
+
+ def self.gc_stress_to_class?
+ unless defined?(@gc_stress_to_class)
+ _, _, status = invoke_ruby(["-e""exit GC.respond_to?(:add_stress_to_class)"])
+ @gc_stress_to_class = status.success?
+ end
+ @gc_stress_to_class
+ end
end
module Test