Class: OrigenTesters::ATP::Processors::Marshal
- Inherits:
-
OrigenTesters::ATP::Processor
- Object
- OrigenTesters::ATP::Processor
- OrigenTesters::ATP::Processors::Marshal
- Defined in:
- lib/origen_testers/atp/processors/marshal.rb
Overview
Makes the AST safe for Marshaling
Instance Method Summary collapse
Methods inherited from OrigenTesters::ATP::Processor
#clean_flag, #extract_volatiles, #handler_missing, #process, #process_all, #run, #volatile?, #volatile_flags
Instance Method Details
#on_object(node) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/origen_testers/atp/processors/marshal.rb', line 5 def on_object(node) o = node.value if o.is_a?(String) = { 'Test' => o } elsif o.is_a?(Hash) = o elsif o.respond_to?(:to_meta) && o. && !o..empty? = o. else = {} end # The test suite / test instance name ['Test'] ||= o.try(:name) ['Pattern'] ||= o.try(:pattern) # The test name column on IG-XL, or the name of a specific instance of a test which shares a common # 'Test' name with other tests ['Test Name'] ||= o.try(:test_name) || o.try(:_test_name) || o.try('TestName') || ['Test'] # The name of the primary test that is logged by the test instance / test method, if it logs more # than one then this is represented by sub_test nodes ['Sub Test Name'] ||= o.try(:sub_test_name) || o.try('SubTestName') || ['Test'] node.updated(nil, []) end |
#on_render(node) ⇒ Object
28 29 30 |
# File 'lib/origen_testers/atp/processors/marshal.rb', line 28 def on_render(node) node.updated(nil, [node.value.to_s]) end |