ruby_memcheck 1.1.2 → 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: fda45a20aaf7c0365ca7605bf5a74ca03d6f7fdf69b962c0c69695319b722739
4
- data.tar.gz: b6ab56e5aa970a8d8c38a5e91b4ed92d93a7f0d1e286f97f749a08f9f44d05a9
3
+ metadata.gz: 01e474f34ff993ba99b7c554d54bf850c49b8fc8f73fdec8702639373673a088
4
+ data.tar.gz: a1413639549cc0493adf456b8f38e6dc6463975dab3ef508459809f3b8307031
5
5
  SHA512:
6
- metadata.gz: 5e66f20481d0b3d8a129dc38c7e0b667d0ac9c418b34b433532c4f739349f8809680d1129f3dc1549dc73b2220f657a399ce9ee7328d23030c138508f5680b90
7
- data.tar.gz: 1d55a41057a27ab8de092717dbbd90174fe6bfbf59f36f0fb120f1a6534c467e63daa8505551b840cdc715c7dd5ce4f258188523f567aaa9fce9560fcbca2dc1
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.2"
4
+ VERSION = "1.2.0"
5
5
  end
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.2
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