Class: Origen::Tester::V93K::Generator::TestMethods
- Inherits:
-
Object
- Object
- Origen::Tester::V93K::Generator::TestMethods
- Defined in:
- lib/origen/tester/v93k/generator/test_methods.rb
Instance Attribute Summary (collapse)
-
- (Object) collection
Origen::Tester::Generator not included since test methods do not have their own top-level sheet, they will be incorporated within the flow sheet.
-
- (Object) flow
Origen::Tester::Generator not included since test methods do not have their own top-level sheet, they will be incorporated within the flow sheet.
Instance Method Summary (collapse)
- - (Object) [](name)
- - (Object) add(name, _type, options = {})
-
- (Boolean) duplicate?(name, options = {})
Returns true if the given test method name has already been added to the current flow.
- - (Object) filename
-
- (TestMethods) initialize(flow)
constructor
A new instance of TestMethods.
Constructor Details
- (TestMethods) initialize(flow)
Returns a new instance of TestMethods
11 12 13 14 15 |
# File 'lib/origen/tester/v93k/generator/test_methods.rb', line 11 def initialize(flow) @flow = flow @collection = {} @ix = 0 end |
Instance Attribute Details
- (Object) collection
Origen::Tester::Generator not included since test methods do not have their own top-level sheet, they will be incorporated within the flow sheet
9 10 11 |
# File 'lib/origen/tester/v93k/generator/test_methods.rb', line 9 def collection @collection end |
- (Object) flow
Origen::Tester::Generator not included since test methods do not have their own top-level sheet, they will be incorporated within the flow sheet
9 10 11 |
# File 'lib/origen/tester/v93k/generator/test_methods.rb', line 9 def flow @flow end |
Instance Method Details
- (Object) [](name)
31 32 33 |
# File 'lib/origen/tester/v93k/generator/test_methods.rb', line 31 def [](name) @collection[name] end |
- (Object) add(name, _type, options = {})
21 22 23 24 25 26 27 28 29 |
# File 'lib/origen/tester/v93k/generator/test_methods.rb', line 21 def add(name, _type, = {}) check_for_duplicates(name) record_test_method(name) func = TestMethod.new(next_name, ) @collection[name] = func # c = Origen.interface.consume_comments # Origen.interface.descriptions.add_for_test_definition(name, c) func end |
- (Boolean) duplicate?(name, options = {})
Returns true if the given test method name has already been added to the current flow.
Pass in :global => true for all test flows to be considered.
38 39 40 41 42 43 44 45 |
# File 'lib/origen/tester/v93k/generator/test_methods.rb', line 38 def duplicate?(name, = {}) files = existing_test_methods[name] if files && !files.empty? [:global] || files.include?(filename) else false end end |
- (Object) filename
17 18 19 |
# File 'lib/origen/tester/v93k/generator/test_methods.rb', line 17 def filename flow.filename end |