Class: OrigenTesters::SmartestBasedTester::Base::ShmooTests

Inherits:
Object
  • Object
show all
Defined in:
lib/origen_testers/smartest_based_tester/v93k_smt8/shmoo_tests.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(flow) ⇒ ShmooTests

Returns a new instance of ShmooTests.



10
11
12
13
14
15
16
17
18
# File 'lib/origen_testers/smartest_based_tester/v93k_smt8/shmoo_tests.rb', line 10

def initialize(flow)
  @flow = flow
  @collection = []
  @existing_names = {}
  # Test names also have to be unique vs. the current flow name
  if tester.smt8?
    @existing_names[flow.filename.sub('.flow', '').to_s] = true
  end
end

Instance Attribute Details

#collectionObject

Origen::Tester::Generator not included since test suites do not have their own top-level sheet, they will be incorporated within the flow sheet



8
9
10
# File 'lib/origen_testers/smartest_based_tester/v93k_smt8/shmoo_tests.rb', line 8

def collection
  @collection
end

#flowObject

Origen::Tester::Generator not included since test suites do not have their own top-level sheet, they will be incorporated within the flow sheet



8
9
10
# File 'lib/origen_testers/smartest_based_tester/v93k_smt8/shmoo_tests.rb', line 8

def flow
  @flow
end

Instance Method Details

#add(name, options = {}) ⇒ Object Also known as: run, run_and_branch



24
25
26
27
28
29
30
31
32
33
# File 'lib/origen_testers/smartest_based_tester/v93k_smt8/shmoo_tests.rb', line 24

def add(name, options = {})
  symbol = name.is_a?(Symbol)
  name = make_unique(name)
  # Ensure names given as a symbol stay as a symbol, this is more for
  # alignment to existing test cases than anything else
  name = name.to_sym if symbol
  shmoo = platform::ShmooTest.new(name, options)
  @collection << shmoo
  shmoo
end

#filenameObject



20
21
22
# File 'lib/origen_testers/smartest_based_tester/v93k_smt8/shmoo_tests.rb', line 20

def filename
  flow.filename
end

#finalizeObject



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
# File 'lib/origen_testers/smartest_based_tester/v93k_smt8/shmoo_tests.rb', line 41

def finalize
  # match any formatting difference between test suite shmoo and test flow shmoo
  @collection.each do |shmoo_test|
    shmoo_test.targets.each_with_index do |target, i|
      target_is_a_test_suite = false
      flow.test_suites.sorted_collection.each do |suite|
        if suite.name.to_s == target.to_s
          target_is_a_test_suite = true
          break
        end
      end

      unless target_is_a_test_suite
        target_is_a_test_flow = false
        flow.sub_flows.each do |name, path|
          target_name = target.to_s.gsub(' ', '_')
          if name.to_s.downcase == target_name.to_s.downcase
            target_is_a_test_flow = true
            shmoo_test.targets[i] = name
            break
          end
        end

        unless target_is_a_test_flow
          fail "Shmoo test target '#{target}' for shmoo test '#{shmoo_test.name}' not found in test suites or sub_flows"
        end
      end
    end
  end
end

#platformObject



37
38
39
# File 'lib/origen_testers/smartest_based_tester/v93k_smt8/shmoo_tests.rb', line 37

def platform
  Origen.interface.platform
end

#sorted_collectionObject



72
73
74
# File 'lib/origen_testers/smartest_based_tester/v93k_smt8/shmoo_tests.rb', line 72

def sorted_collection
  @collection.sort_by { |st| st.name.to_s }
end