Class: OrigenTesters::SmartestBasedTester::Base::TestMethods::BaseTml

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

Overview

Base class of all test method libraries

Direct Known Subclasses

AcTml, CustomTml, DcTml

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(test_methods) ⇒ BaseTml

Returns a new instance of BaseTml.



10
11
12
# File 'lib/origen_testers/smartest_based_tester/base/test_methods/base_tml.rb', line 10

def initialize(test_methods)
  @test_methods = test_methods
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/origen_testers/smartest_based_tester/base/test_methods/base_tml.rb', line 14

def method_missing(method, *args, &block)
  if definitions[method]
    m = platform::TestMethod.new methods: definitions[method].dup,
                                 attrs:   (args.first || {}),
                                 type:    method,
                                 library: self
    test_methods.add(m)
    m
  else
    super
  end
end

Instance Attribute Details

#test_methodsObject (readonly)

Returns the test_methods object for the current flow



8
9
10
# File 'lib/origen_testers/smartest_based_tester/base/test_methods/base_tml.rb', line 8

def test_methods
  @test_methods
end

Instance Method Details

#definitionsObject



31
32
33
# File 'lib/origen_testers/smartest_based_tester/base/test_methods/base_tml.rb', line 31

def definitions
  @definitions || self.class::TEST_METHODS
end

#platformObject



27
28
29
# File 'lib/origen_testers/smartest_based_tester/base/test_methods/base_tml.rb', line 27

def platform
  Origen.interface.platform
end