Class: OrigenTesters::ATP::Processors::Relationship::ExtractTestResults

Inherits:
OrigenTesters::ATP::Processor show all
Defined in:
lib/origen_testers/atp/processors/relationship.rb

Overview

Extracts all test-result nodes from the given AST

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from OrigenTesters::ATP::Processor

#add_global_flag, #clean_flag, #extract_globals, #extract_volatiles, #global_flag?, #global_flags, #handler_missing, #process, #process_all, #run, #volatile?, #volatile_flags

Instance Attribute Details

#resultsObject (readonly)

Returns the value of attribute results.



12
13
14
# File 'lib/origen_testers/atp/processors/relationship.rb', line 12

def results
  @results
end

Instance Method Details

#on_if_failed(node) ⇒ Object Also known as: on_if_any_failed, on_if_all_failed, on_if_any_sites_failed, on_if_all_sites_failed



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/origen_testers/atp/processors/relationship.rb', line 14

def on_if_failed(node)
  ids, *children = *node
  unless ids.is_a?(Array)
    ids = [ids]
  end
  ids.each do |id|
    results[id] ||= {}
    results[id][:failed] = true
  end
  process_all(children)
end

#on_if_passed(node) ⇒ Object Also known as: on_if_any_passed, on_if_all_passed, on_if_any_sites_passed, on_if_all_sites_passed



30
31
32
33
34
35
36
37
38
39
40
# File 'lib/origen_testers/atp/processors/relationship.rb', line 30

def on_if_passed(node)
  ids, *children = *node
  unless ids.is_a?(Array)
    ids = [ids]
  end
  ids.each do |id|
    results[id] ||= {}
    results[id][:passed] = true
  end
  process_all(children)
end

#on_if_ran(node) ⇒ Object Also known as: on_unless_ran



46
47
48
49
50
51
# File 'lib/origen_testers/atp/processors/relationship.rb', line 46

def on_if_ran(node)
  id, *children = *node
  results[id] ||= {}
  results[id][:ran] = true
  process_all(children)
end