class BaseChip::TestList

Public Class Methods

new() click to toggle source
Calls superclass method
# File lib/base_chip/test_list.rb, line 31
def initialize
  super
  @num_tests = 0
end

Public Instance Methods

configure() click to toggle source
Calls superclass method
# File lib/base_chip/test_list.rb, line 42
def configure
  return if @configured
  @directory ||= "#{configuration.out_directory}/#{name}"
  super
  return unless @tests
  return unless @permutes
  tests = @tests.values
  @permutes.each_value do |permute|
    permute.configure
    next unless permute.permutations
    tests.map! do |t|
      permute.permutations.values.map do |permutation|
        test = t.dup
        test.name = "#{test.name}_#{permute.name}#{permutation.name}".to_sym
        test.blks += permutation.blks
        test
      end
    end
    tests.flatten!
  end

  if @posts
    tests.each do |t|
      @posts.each_value do |p|
        p.blks.each do |b|
          b.parameters.empty? ? t.instance_exec(&b) : b.call(t)
        end
      end
    end
  end
  if @requirements
    new_tests = []
    tests.each do |t|
      t.configure
      ditch = false
      @requirements.each_value do |m|
        m.blks.each do |b|
          ditch = !(b.parameters.empty? ? t.instance_exec(&b) : b.call(t))
          break if ditch
        end
        break if ditch
      end
      next if ditch
      new_tests << t
    end
    tests = new_tests
  end
  @tests = {}
  tests.each do |t|
    name = t.name
    i = 0
    while @tests[name]
      name = "#{t.name}_#{i+=1}"
    end
    t.name = name.to_sym
    @tests[name] = t
  end
end
dereference_workload(tests = nil,passive = false) click to toggle source
# File lib/base_chip/test_list.rb, line 100
def dereference_workload(tests = nil,passive = false)
  configure
  tests ||= ['all']
  out = []
  return out unless @tests
  tests.each do |t|
    if t == 'all'
      out += @tests.values
    else
      if foo = @tests[t.to_sym]
        out << foo
      else
        fault "Could not find test #{t.inspect} in list #{@name.inspect} in block #{@block.name.inspect}" unless passive
      end
    end
  end
  out
end
old_post( name=:no_name,&blk)
Alias for: post
old_requirement(name=:no_name,&blk)

def actions

parent.actions

end

Alias for: requirement
post( name=:no_name,&blk) click to toggle source
# File lib/base_chip/test_list.rb, line 41
def post(       name=:no_name,&blk); old_post(       name,&blk) end
Also aliased as: old_post
requirement(name=:no_name,&blk) click to toggle source
# File lib/base_chip/test_list.rb, line 40
def requirement(name=:no_name,&blk); old_requirement(name,&blk) end
Also aliased as: old_requirement