diff options
author | Koichi Sasada <ko1@atdot.net> | 2019-12-12 03:31:13 +0900 |
---|---|---|
committer | Koichi Sasada <ko1@atdot.net> | 2019-12-12 03:32:12 +0900 |
commit | 79eb5e1acac2339c6ec71db723298bdfcd92b233 (patch) | |
tree | 41c13928101f167a37761c39e432d3a85169c146 /tool/lib | |
parent | 51cc5a26df5f47ecdd88398ba1a50a8e62182649 (diff) | |
download | ruby-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.rb | 10 |
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'] |