Sha256: bf3cfef3bb5c9e56bbe4649b2991150c1bd4a2acd5065cca65ddcc740869d1db

Contents?: true

Size: 669 Bytes

Versions: 91

Compression:

Stored size: 669 Bytes

Contents

require_relative './tests/test'
module Origen
  module Tests
    def tests(expr = nil)
      if expr.nil?
        if @_tests.nil?
          @_tests = {}
        elsif @_tests.is_a? Hash
          if @_tests.empty?
            @_tests
          else
            @_tests.ids
          end
        else
          @_tests = {}
        end
      else
        @_tests.recursive_find_by_key(expr)
      end
    end

    def add_test(id, options = {}, &block)
      @_tests ||= {}
      if @_tests.include?(id)
        Origen.log.error("Cannot create test '#{id}', it already exists!")
        fail
      end
      @_tests[id] = Test.new(id, options, &block)
    end
  end
end

Version data entries

91 entries across 91 versions & 1 rubygems

Version Path
origen-0.60.17 lib/origen/tests.rb
origen-0.60.16 lib/origen/tests.rb
origen-0.60.14 lib/origen/tests.rb
origen-0.60.13 lib/origen/tests.rb
origen-0.60.12 lib/origen/tests.rb
origen-0.60.11 lib/origen/tests.rb
origen-0.60.10 lib/origen/tests.rb
origen-0.60.9 lib/origen/tests.rb
origen-0.60.8 lib/origen/tests.rb
origen-0.60.7 lib/origen/tests.rb
origen-0.60.6 lib/origen/tests.rb
origen-0.60.5 lib/origen/tests.rb
origen-0.60.4 lib/origen/tests.rb
origen-0.60.3 lib/origen/tests.rb
origen-0.60.2 lib/origen/tests.rb
origen-0.60.1 lib/origen/tests.rb
origen-0.60.0 lib/origen/tests.rb
origen-0.59.8 lib/origen/tests.rb
origen-0.59.7 lib/origen/tests.rb
origen-0.59.6 lib/origen/tests.rb