# File lib/active_support/testing/performance.rb, line 32 32: def full_test_name 33: "#{self.class.name}##{method_name}" 34: end
# File lib/active_support/testing/performance.rb, line 36 36: def run(result) 37: return if method_name =~ /^default_test$/ 38: 39: yield(self.class::STARTED, name) 40: @_result = result 41: 42: run_warmup 43: if profile_options && metrics = profile_options[:metrics] 44: metrics.each do |metric_name| 45: if klass = Metrics[metric_name.to_sym] 46: run_profile(klass.new) 47: result.add_run 48: end 49: end 50: end 51: 52: yield(self.class::FINISHED, name) 53: end
# File lib/active_support/testing/performance.rb, line 55 55: def run_test(metric, mode) 56: run_callbacks :setup 57: setup 58: metric.send(mode) { __send__ @method_name } 59: rescue ::Test::Unit::AssertionFailedError => e 60: add_failure(e.message, e.backtrace) 61: rescue StandardError, ScriptError => e 62: add_error(e) 63: ensure 64: begin 65: teardown 66: run_callbacks :teardown, :enumerator => :reverse_each 67: rescue ::Test::Unit::AssertionFailedError => e 68: add_failure(e.message, e.backtrace) 69: rescue StandardError, ScriptError => e 70: add_error(e) 71: end 72: end
# File lib/active_support/testing/performance.rb, line 85 85: def run_profile(metric) 86: klass = profile_options[:benchmark] ? Benchmarker : Profiler 87: performer = klass.new(self, metric) 88: 89: performer.run 90: puts performer.report 91: performer.record 92: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.