Sha256: de16bfcfe1ceea904c8e74e37cafdcc40564bf8a6b2a86daea8cfc3226f7a79d
Contents?: true
Size: 1.57 KB
Versions: 11
Compression:
Stored size: 1.57 KB
Contents
require 'active_support/concern' module OrigenTesters # Include this module to create an interface that supports multiple tester # types. # # This module will expose generators for all test platforms supported by # the Testers plugin. module ProgramGenerators extend ActiveSupport::Concern PLATFORMS = [J750, J750_HPT, UltraFLEX, V93K] included do Origen.add_interface(self) end module ClassMethods # Ensures that the correct generator is loaded before initialize is called def new(*args, &block) x = allocate x._load_generator x.send(:initialize, *args, &block) x end # Returns true if the interface class supports the # given tester instance def supports?(tester_instance) PLATFORMS.include?(tester_instance.class) end end def initialize(options = {}) end def tester Origen.tester end def _load_generator if tester.v93k? class << self; include OrigenTesters::V93K::Generator; end elsif tester.j750_hpt? class << self; include OrigenTesters::J750_HPT::Generator; end elsif tester.j750? class << self; include OrigenTesters::J750::Generator; end elsif tester.ultraflex? class << self; include OrigenTesters::UltraFLEX::Generator; end elsif defined? tester.class::TEST_PROGRAM_GENERATOR class << self; include tester.class::TEST_PROGRAM_GENERATOR; end else fail "The OrigenTesters::ProgramGenerators module does not support #{tester.class}!" end end end end
Version data entries
11 entries across 11 versions & 1 rubygems