-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add valgrind_generate_suppressions option to configuration
valgrind_generate_suppressions will generate suppressions in the output.
- Loading branch information
1 parent
396aaf3
commit 8af14c8
Showing
5 changed files
with
64 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# frozen_string_literal: true | ||
|
||
require "test_helper" | ||
require "nokogiri" | ||
|
||
module RubyMemcheck | ||
class ValgrindErrorTest < Minitest::Test | ||
def setup | ||
@configuration = Configuration.new(binary_name: "ruby_memcheck_c_test") | ||
end | ||
|
||
def test_raises_when_suppressions_generated_but_not_configured | ||
output = ::Nokogiri::XML(<<~XML).at_xpath("//error") | ||
<error> | ||
<unique>0x1ab8</unique> | ||
<tid>1</tid> | ||
<kind>Leak_DefinitelyLost</kind> | ||
<xwhat> | ||
<text>48 bytes in 1 blocks are definitely lost in loss record 6,841 of 11,850</text> | ||
<leakedbytes>48</leakedbytes> | ||
<leakedblocks>1</leakedblocks> | ||
</xwhat> | ||
<stack> | ||
</stack> | ||
<suppression> | ||
</suppression> | ||
</foo> | ||
XML | ||
|
||
error = assert_raises do | ||
RubyMemcheck::ValgrindError.new(@configuration, output) | ||
end | ||
assert_equal(ValgrindError::SUPPRESSION_NOT_CONFIGURED_ERROR_MSG, error.message) | ||
end | ||
end | ||
end |