diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-10-16 08:39:39 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-10-16 08:39:39 +0000 |
commit | 955a38da08b64a1c4092f6f8cc3527ce50598092 (patch) | |
tree | 3c7fa39dce7e512385098ac98ef363e5fc63322e /test/-ext-/bug_reporter | |
parent | c6b599e1b60c6cd99f0276290c53d95731a26238 (diff) | |
download | ruby-955a38da08b64a1c4092f6f8cc3527ce50598092.tar.gz |
* error.c, internal.h (rb_bug_reporter_add): add a new C-API.
rb_bug_reporter_add() allows to register a function which
is called at rb_bug() called.
* ext/-test-/bug_reporter/bug_reporter.c: add a test for this C-API.
* ext/-test-/bug_reporter/extconf.rb: ditto.
* test/-ext-/bug_reporter/test_bug_reporter.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/-ext-/bug_reporter')
-rw-r--r-- | test/-ext-/bug_reporter/test_bug_reporter.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/-ext-/bug_reporter/test_bug_reporter.rb b/test/-ext-/bug_reporter/test_bug_reporter.rb new file mode 100644 index 0000000000..319f3ffe9a --- /dev/null +++ b/test/-ext-/bug_reporter/test_bug_reporter.rb @@ -0,0 +1,9 @@ +require 'test/unit'
+require_relative "../../ruby/envutil"
+
+class TestBugReporter < Test::Unit::TestCase
+ def test_bug_reporter_add
+ expected_stderr = /Sample bug reporter: 12345/
+ assert_in_out_err(["--disable-gems", "-r-test-/bug_reporter/bug_reporter", "-e", "register_sample_bug_reporter(12345); Process.kill :SEGV, $$"], "", [], expected_stderr, nil)
+ end
+end
|