Sha256: 8947a356a09c813ea1661ae92f18b792770fc1402218378191e6fd1d5df4e2c2

Contents?: true

Size: 1.24 KB

Versions: 1

Compression:

Stored size: 1.24 KB

Contents

module OrigenTesters
  module SmartestBasedTester
    class Base
      module Processors
        # Implements continue on a fail branch for V93K by removing any bin nodes that are
        # siblings of continue nodes. The continue nodes are also removed in the process since
        # they have now served their function.
        class ContinueImplementer < ATP::Processor
          # Delete any on-fail child if it's 'empty'
          def on_on_fail(node)
            if cont = node.find(:continue) || @continue
              node = node.updated(nil, node.children - [cont] - node.find_all(:set_result))
            end
            node.updated(nil, process_all(node.children))
          end

          def on_group(node)
            f = node.find(:on_fail)
            if f && f.find(:continue)
              with_continue do
                node = node.updated(nil, process_all(node.children))
              end
              node
            else
              node.updated(nil, process_all(node.children))
            end
          end

          def with_continue
            orig = @continue
            @continue = true
            yield
            @continue = orig
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
origen_testers-0.13.2 lib/origen_testers/smartest_based_tester/base/processors/continue_implementer.rb