OpenCores
URL https://opencores.org/ocsvn/soc_maker/soc_maker/trunk

Subversion Repositories soc_maker

[/] [soc_maker/] [trunk/] [spec/] [soc_def_spec.rb] - Diff between revs 8 and 9

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 8 Rev 9
Line 175... Line 175...
 
 
      it "should return non-nil value, if a instance is added once" do
      it "should return non-nil value, if a instance is added once" do
        @soc.add_core(  "mycore", "rel1", "core_inst" ).should_not be == false
        @soc.add_core(  "mycore", "rel1", "core_inst" ).should_not be == false
      end
      end
 
 
      it "should return nil if a connection is added twice" do
      # in one of the first version, we returned nil, but now this is
 
      # used to extend a interface
 
      it "should not return nil if a connection is added twice" do
        @soc.cons[ :a_con ] = { rule: "or", mapping: [ { :core_a => :ifc_a }, { :core_b => :ifc_b } ] }
        @soc.cons[ :a_con ] = { rule: "or", mapping: [ { :core_a => :ifc_a }, { :core_b => :ifc_b } ] }
        @soc.add_connection(  "core_a", "ifc_a", "core_c", "ifc_b", "a_con" ).should be == nil
        @soc.add_connection(  "core_a", "ifc_a", "core_c", "ifc_b", "a_con" ).should_not be == nil
      end
      end
 
 
      it "should raise a library error when adding an unknown core" do
      it "should raise a library error when adding an unknown core" do
        expect{ @soc.add_core( "some_unknown_core", "v_xyz", "test" ) }.
        expect{ @soc.add_core( "some_unknown_core", "v_xyz", "test" ) }.
          to raise_error( SOCMaker::ERR::LibError )
          to raise_error( SOCMaker::ERR::LibError )
Line 190... Line 192...
      it "should create a dir and return the absolute path for a core inside the build/hdl dir" do
      it "should create a dir and return the absolute path for a core inside the build/hdl dir" do
        SOCMaker::conf[ :build_dir ] = "./spec/tmp_build"
        SOCMaker::conf[ :build_dir ] = "./spec/tmp_build"
        SOCMaker::conf[ :hdl_dir   ] = "hdl"
        SOCMaker::conf[ :hdl_dir   ] = "hdl"
        path = File.expand_path "./spec/tmp_build/hdl/a_core"
        path = File.expand_path "./spec/tmp_build/hdl/a_core"
        FileUtils.rmdir( path ) if File.directory?( path )
        FileUtils.rmdir( path ) if File.directory?( path )
        res = @soc.get_and_ensure_dst_dir!( "a_core" )
        res = SOCMaker::Component::get_and_ensure_dst_dir!( "a_core" )
        File.directory?( path ).should be == true
        File.directory?( path ).should be == true
        res.should be == path
        res.should be == path
      end
      end
 
 
      it "should return false, when an interface is not used" do
      it "should return false, when an interface is not used" do

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.