aboutsummaryrefslogtreecommitdiffstats
path: root/tool/lib
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2019-12-12 03:31:13 +0900
committerKoichi Sasada <ko1@atdot.net>2019-12-12 03:32:12 +0900
commit79eb5e1acac2339c6ec71db723298bdfcd92b233 (patch)
tree41c13928101f167a37761c39e432d3a85169c146 /tool/lib
parent51cc5a26df5f47ecdd88398ba1a50a8e62182649 (diff)
downloadruby-79eb5e1acac2339c6ec71db723298bdfcd92b233.tar.gz
call GC.compact after each test.
RUBY_TEST_GC_COMPACT=1 enables GC.compact checker which calls GC.compact after each test.
Diffstat (limited to 'tool/lib')
-rw-r--r--tool/lib/gc_compact_checker.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/tool/lib/gc_compact_checker.rb b/tool/lib/gc_compact_checker.rb
new file mode 100644
index 0000000000..a6ef3d3ce8
--- /dev/null
+++ b/tool/lib/gc_compact_checker.rb
@@ -0,0 +1,10 @@
+# frozen_string_literal: true
+
+module GCCompactChecker
+ def after_teardown
+ super
+ GC.compact
+ end
+end
+
+Test::Unit::TestCase.include GCCompactChecker if ENV['RUBY_TEST_GC_COMPACT']