Class: OrigenTesters::SmartestBasedTester::Base::TestSuite

Inherits:
Object
  • Object
show all
Defined in:
lib/origen_testers/smartest_based_tester/base/test_suite.rb

Direct Known Subclasses

V93K::TestSuite, V93K_SMT8::TestSuite

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, attrs = {}) ⇒ TestSuite

Returns a new instance of TestSuite.



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
# File 'lib/origen_testers/smartest_based_tester/base/test_suite.rb', line 7

def initialize(name, attrs = {})
  @name = name
  if interface.unique_test_names == :signature
    if interface.flow.sig
      @name = "#{name}_#{interface.flow.sig}"
    end
  elsif interface.unique_test_names == :flowname || interface.unique_test_names == :flow_name
    @name = "#{name}_#{interface.flow.name.to_s.symbolize}"
  elsif interface.unique_test_names == :preflowname || interface.unique_test_names == :pre_flow_name
    @name = "#{interface.flow.name.to_s.symbolize}_#{name}"
  elsif interface.unique_test_names
    utn_string = interface.unique_test_names.to_s
    if utn_string =~ /^prepend_/
      utn_string = utn_string.gsub(/^prepend_/, '')
      @name = "#{utn_string}_#{name}"
    else
      utn_string = utn_string.gsub(/^append_/, '')
      @name = "#{name}_#{utn_string}"
    end
  end
  # Set the defaults
  self.class::DEFAULTS.each do |k, v|
    send("#{k}=", v)
  end
  # Then the values that have been supplied
  attrs.each do |k, v|
    send("#{k}=", v) if respond_to?("#{k}=") && k.to_sym != :name
  end
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



55
56
57
58
59
60
61
# File 'lib/origen_testers/smartest_based_tester/base/test_suite.rb', line 55

def method_missing(method, *args, &block)
  if test_method && test_method.respond_to?(method)
    test_method.send(method, *args, &block)
  else
    super
  end
end

Instance Attribute Details

#metaObject

Returns the value of attribute meta.



5
6
7
# File 'lib/origen_testers/smartest_based_tester/base/test_suite.rb', line 5

def meta
  @meta
end

Instance Method Details

#extract_atp_attributes(options) ⇒ Object



78
79
80
# File 'lib/origen_testers/smartest_based_tester/base/test_suite.rb', line 78

def extract_atp_attributes(options)
  options[:limits] ||= limits.to_atp_attributes
end

#inspectObject



46
47
48
# File 'lib/origen_testers/smartest_based_tester/base/test_suite.rb', line 46

def inspect
  "<TestSuite: #{name}>"
end

#interfaceObject



67
68
69
# File 'lib/origen_testers/smartest_based_tester/base/test_suite.rb', line 67

def interface
  Origen.interface
end

#name=(val, options = {}) ⇒ Object

The name is immutable once the test_suite is created, this will raise an error when called



51
52
53
# File 'lib/origen_testers/smartest_based_tester/base/test_suite.rb', line 51

def name=(val, options = {})
  fail 'Once assigned the name of a test suite cannot be changed!'
end

#pattern=(name) ⇒ Object



41
42
43
44
# File 'lib/origen_testers/smartest_based_tester/base/test_suite.rb', line 41

def pattern=(name)
  Origen.interface.record_pattern_reference(name) if name
  @pattern = name
end

#respond_to?(method) ⇒ Boolean

Returns:

  • (Boolean)


63
64
65
# File 'lib/origen_testers/smartest_based_tester/base/test_suite.rb', line 63

def respond_to?(method)
  (test_method && test_method.respond_to?(method)) || super
end

#smt8?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/origen_testers/smartest_based_tester/base/test_suite.rb', line 37

def smt8?
  tester.smt8?
end

#to_metaObject



71
72
73
74
75
76
# File 'lib/origen_testers/smartest_based_tester/base/test_suite.rb', line 71

def to_meta
  m = meta || {}
  m['Test'] = name
  m['Test Name'] ||= try(:test_name)
  m
end