ruby_memcheck 1.1.1 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 47dfcdc3712a08c2667460c8889013ed679e23251f445a1ae2a106d8e73d10ad
4
- data.tar.gz: 87953c122bb21303ecd219c394fa5ba29b3c6a73c147f64efcc463804ad85b88
3
+ metadata.gz: 01e474f34ff993ba99b7c554d54bf850c49b8fc8f73fdec8702639373673a088
4
+ data.tar.gz: a1413639549cc0493adf456b8f38e6dc6463975dab3ef508459809f3b8307031
5
5
  SHA512:
6
- metadata.gz: 1890f1d919f0c0899be7df94f60875f27618f7e12b99410a0f955fb4722710d37e1efed2d58be00a40ae1d175c585731f95b810ed207075b5aed79e5a834a7d6
7
- data.tar.gz: 62b50b839826ee5a65565bbe692fa37aafe16aa5c3de1bd1ae27c85ece57e5ce35b956a0ba7e9e1bf4b7ae40227aa7e1bdf354a2bcbbe77c9231fa6329149ef2
6
+ metadata.gz: ade6759ab00942eb4dc1ebd5f5e3578d316c49cdf69e979e42ec5d37a8215d139d9765bca26f519158764613d51ed58f01bed055ba70b17860e0d15d7b1c9a89
7
+ data.tar.gz: 46b92557fbf9dca12a6b3a9f5196d95d54d44b886f06d46beb7b6afe7768476decc921c0f893864e9417328453f45346a4bf91159df8fe3bd529091b19637b90
data/README.md CHANGED
@@ -121,18 +121,6 @@ The easiest way to use this gem is to use it on your test suite (minitest or RSp
121
121
  end
122
122
  ```
123
123
 
124
- 1. Add the following line to your `test_helper.rb` or `spec_helper.rb`:
125
-
126
- ```ruby
127
- at_exit { GC.start }
128
- ```
129
-
130
- This will run a major garbage collection cycle before the Ruby process shuts down. This will ensure that any remaining Ruby objects are collected which will prevent Valgrind from reporting false positives.
131
-
132
- It is safest to add the line above at the very first line of `test_helper.rb` or `spec_helper.rb`.
133
-
134
- - **For minitest:** It is important that the line above is added BEFORE the `require "minitest/autorun"` line.
135
-
136
124
  1. You're ready to run your test suite with Valgrind using `rake test:valgrind` or `rake spec:valgrind`! Note that this will take a while to run because Valgrind will make Ruby significantly slower.
137
125
  1. (Optional) If you find false positives in the output, you can create Valgrind suppression files. See the [`Suppression files`](#suppression-files) section for more details.
138
126
 
@@ -40,6 +40,7 @@ module RubyMemcheck
40
40
  def spec_command
41
41
  # First part of command is Ruby
42
42
  args = super.split(" ")[1..]
43
+ args.unshift("-r" + File.expand_path(File.join(__dir__, "../test_helper.rb")))
43
44
 
44
45
  configuration.command(args)
45
46
  end
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ at_exit { GC.start }
@@ -18,6 +18,7 @@ module RubyMemcheck
18
18
  end
19
19
 
20
20
  def ruby(*args, **options, &block)
21
+ args.unshift("-r" + File.expand_path(File.join(__dir__, "test_helper.rb")))
21
22
  command = configuration.command(args)
22
23
  sh(command, **options) do |ok, res|
23
24
  report_valgrind_errors
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyMemcheck
4
- VERSION = "1.1.1"
4
+ VERSION = "1.2.0"
5
5
  end
@@ -23,7 +23,6 @@
23
23
  recursive_list_access creates a hash called `list` that is stored on the threadptr_recursive_hash. This is reported as a memory leak.
24
24
  Memcheck:Leak
25
25
  ...
26
- fun:rb_st_init_table
27
26
  fun:rb_ident_hash_new
28
27
  fun:recursive_list_access
29
28
  fun:exec_recursive
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_memcheck
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Zhu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-10-19 00:00:00.000000000 Z
11
+ date: 2022-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -143,6 +143,7 @@ files:
143
143
  - lib/ruby_memcheck/rspec/rake_task.rb
144
144
  - lib/ruby_memcheck/stack.rb
145
145
  - lib/ruby_memcheck/suppression.rb
146
+ - lib/ruby_memcheck/test_helper.rb
146
147
  - lib/ruby_memcheck/test_task.rb
147
148
  - lib/ruby_memcheck/test_task_reporter.rb
148
149
  - lib/ruby_memcheck/valgrind_error.rb