ruby_memcheck 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ruby_memcheck/test_task_reporter.rb +15 -8
- data/lib/ruby_memcheck/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6afc968d17cd1fabb39f254c3f2373534773e42b094345765c058538cc05b208
|
4
|
+
data.tar.gz: fe3603ae51113b37d9e07b38e981c0ddab8e9b5059c8c8a797dbc21f5dd31b30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4402ac65e791413b6e46abf296d21ca1bcd6277469a743a9f00fbadb3802993746ccdd89064de7171c1a4609c8162c245ef8d08d4314e0d598abb1a7f287585
|
7
|
+
data.tar.gz: '08dfe5c75b6502f563b739d98c8821b3c199fe37dae0f1078158ffc4e43933d18bd508efd7901320c4ad254c4703cbf78ba1de7afe734122acf368d99503e7f7'
|
@@ -10,8 +10,9 @@ module RubyMemcheck
|
|
10
10
|
|
11
11
|
def report_valgrind_errors
|
12
12
|
if configuration.valgrind_xml_dir
|
13
|
-
|
14
|
-
|
13
|
+
xml_files = valgrind_xml_files
|
14
|
+
parse_valgrind_output(xml_files)
|
15
|
+
remove_valgrind_xml_files(xml_files)
|
15
16
|
|
16
17
|
unless errors.empty?
|
17
18
|
output_valgrind_errors
|
@@ -20,12 +21,16 @@ module RubyMemcheck
|
|
20
21
|
end
|
21
22
|
end
|
22
23
|
|
23
|
-
def
|
24
|
+
def valgrind_xml_files
|
25
|
+
Dir[File.join(configuration.valgrind_xml_dir, "*")]
|
26
|
+
end
|
27
|
+
|
28
|
+
def parse_valgrind_output(xml_files)
|
24
29
|
require "nokogiri"
|
25
30
|
|
26
31
|
@errors = []
|
27
32
|
|
28
|
-
|
33
|
+
xml_files.each do |file|
|
29
34
|
Nokogiri::XML::Reader(File.open(file)).each do |node|
|
30
35
|
next unless node.name == "error" && node.node_type == Nokogiri::XML::Reader::TYPE_ELEMENT
|
31
36
|
error_xml = Nokogiri::XML::Document.parse(node.outer_xml).root
|
@@ -36,15 +41,17 @@ module RubyMemcheck
|
|
36
41
|
end
|
37
42
|
end
|
38
43
|
|
44
|
+
def remove_valgrind_xml_files(xml_files)
|
45
|
+
xml_files.each do |file|
|
46
|
+
File.delete(file)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
39
50
|
def output_valgrind_errors
|
40
51
|
@errors.each do |error|
|
41
52
|
configuration.output_io.puts error
|
42
53
|
configuration.output_io.puts
|
43
54
|
end
|
44
55
|
end
|
45
|
-
|
46
|
-
def remove_valgrind_xml_files
|
47
|
-
FileUtils.rm_rf(configuration.valgrind_xml_dir)
|
48
|
-
end
|
49
56
|
end
|
50
57
|
end
|