* test/lib/leakchecker.rb (check): refactor.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
eregon 2015-06-13 19:42:03 +00:00
parent c4dba39028
commit b1e064fc05
2 changed files with 11 additions and 5 deletions

View File

@ -1,3 +1,7 @@
Sun Jun 14 04:40:32 2015 Benoit Daloze <eregontp@gmail.com>
* test/lib/leakchecker.rb (check): refactor.
Sun Jun 14 04:34:14 2015 Benoit Daloze <eregontp@gmail.com>
* test/lib/leakchecker.rb: Return false for no leaks.

View File

@ -7,11 +7,13 @@ class LeakChecker
end
def check(test_name)
leaked1 = check_fd_leak(test_name)
leaked2 = check_thread_leak(test_name)
leaked3 = check_tempfile_leak(test_name)
leaked4 = check_env(test_name)
GC.start if leaked1 || leaked2 || leaked3 || leaked4
leaks = [
check_fd_leak(test_name),
check_thread_leak(test_name),
check_tempfile_leak(test_name),
check_env(test_name)
]
GC.start if leaks.any?
end
def find_fds