Module: Minitest
- Defined in:
- lib/minitest/stackprof.rb,
lib/minitest/stackprof_plugin.rb,
lib/minitest/stackprof/version.rb
Defined Under Namespace
Modules: StackProfPlugin, Stackprof
Classes: StackProfReporter
Class Method Summary
collapse
Class Method Details
.plugin_stackprof_init(options) ⇒ Object
62
63
64
65
66
67
68
69
70
|
# File 'lib/minitest/stackprof_plugin.rb', line 62
def self.plugin_stackprof_init(options)
if output_file = options[:stackprof]
require 'stackprof'
puts "Stackprof enabled - dumping results to #{output_file}"
puts "Stackprof: #{"NOT " if !StackProfPlugin.include_setup_and_teardown?} profiling the setup/teardown"
Minitest::Test.prepend StackProfPlugin
reporter << StackProfReporter.new(output_file)
end
end
|
.plugin_stackprof_options(opts, options) ⇒ Object
54
55
56
57
58
59
60
61
|
# File 'lib/minitest/stackprof_plugin.rb', line 54
def self.plugin_stackprof_options(opts, options)
opts.on '--profile-setup', 'profile the setup and teardown as well as the test' do
StackProfPlugin.include_setup_and_teardown = true
end
opts.on '--stackprof[=FILE]', String, 'run under stackprof (optionally specifies the output file)' do |file|
options[:stackprof] = file || "stackprof-minitest-#{Process.pid}.dump"
end
end
|