Class: OrigenTesters::ATP::Processors::ApplyPostGroupActions

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

Overview

This removes on_pass/fail operations from groups and applies them to all contained tests

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, #volatile?, #volatile_flags

Instance Method Details

#on_group(node) ⇒ Object



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

def on_group(node)
  on_pass = node.find(:on_pass)
  on_fail = node.find(:on_fail)
  @on_pass << on_pass
  @on_fail << on_fail
  node = node.remove(on_pass) if on_pass
  node = node.remove(on_fail) if on_fail
  node = node.updated(nil, process_all(node.children))
  @on_fail.pop
  @on_pass.pop
  node
end

#on_on_fail(node) ⇒ Object



40
41
42
43
44
45
46
47
# File 'lib/origen_testers/atp/processors/apply_post_group_actions.rb', line 40

def on_on_fail(node)
  @on_fail.each do |on_fail|
    if on_fail
      node = node.updated(nil, node.children + process_all(on_fail.children))
    end
  end
  node
end

#on_on_pass(node) ⇒ Object



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

def on_on_pass(node)
  @on_pass.each do |on_pass|
    if on_pass
      node = node.updated(nil, node.children + process_all(on_pass.children))
    end
  end
  node
end

#on_test(node) ⇒ Object



25
26
27
28
29
# File 'lib/origen_testers/atp/processors/apply_post_group_actions.rb', line 25

def on_test(node)
  node = node.ensure_node_present(:on_pass) if @on_pass.any? { |n| n }
  node = node.ensure_node_present(:on_fail) if @on_fail.any? { |n| n }
  node.updated(nil, process_all(node.children))
end

#run(node) ⇒ Object



6
7
8
9
10
# File 'lib/origen_testers/atp/processors/apply_post_group_actions.rb', line 6

def run(node)
  @on_pass = []
  @on_fail = []
  process(node)
end