File: rspec_exclusions.rb

package info (click to toggle)
ruby-test-prof 0.12.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 508 kB
  • sloc: ruby: 4,075; makefile: 4
file content (93 lines) | stat: -rw-r--r-- 2,221 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# frozen_string_literal: true

module TestProf
  module RubyProf
    # Generates the list of RSpec (framework internal) methods
    # to exclude from profiling
    module RSpecExclusions
      module_function

      def generate
        {
          RSpec::Core::Runner => %i[
            run
            run_specs
          ],

          RSpec::Core::ExampleGroup => %i[
            run
            run_examples
          ],

          RSpec::Core::ExampleGroup.singleton_class => %i[
            run
            run_examples
          ],

          RSpec::Core::Example => %i[
            run
            with_around_and_singleton_context_hooks
            with_around_example_hooks
            instance_exec
            run_before_example
          ],

          RSpec::Core::Example.singleton_class => %i[
            run
            with_around_and_singleton_context_hooks
            with_around_example_hooks
          ],

          RSpec::Core::Example::Procsy => [
            :call
          ],

          RSpec::Core::Hooks::HookCollections => %i[
            run
            run_around_example_hooks_for
            run_example_hooks_for
            run_owned_hooks_for
          ],

          RSpec::Core::Hooks::BeforeHook => [
            :run
          ],

          RSpec::Core::Hooks::AroundHook => [
            :execute_with
          ],

          RSpec::Core::Configuration => [
            :with_suite_hooks
          ],

          RSpec::Core::Reporter => [
            :report
          ]
        }.tap do |data|
          if defined?(RSpec::Support::ReentrantMutex)
            data[RSpec::Support::ReentrantMutex] = [
              :synchronize
            ]
          end

          if defined?(RSpec::Core::MemoizedHelpers::ThreadsafeMemoized)
            data.merge!(
              RSpec::Core::MemoizedHelpers::ThreadsafeMemoized => [
                :fetch_or_store
              ],

              RSpec::Core::MemoizedHelpers::NonThreadSafeMemoized => [
                :fetch_or_store
              ],

              RSpec::Core::MemoizedHelpers::ContextHookMemoized => [
                :fetch_or_store
              ]
            )
          end
        end
      end
    end
  end
end