Skip to content

Commit

Permalink
Add test of desiredName for modules in objects
Browse files Browse the repository at this point in the history
Signed-off-by: Schuyler Eldridge <[email protected]>
  • Loading branch information
seldridge committed Sep 27, 2019
1 parent d0edb9f commit 33334bc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/test/scala/chiselTests/Module.scala
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ class NullModuleWrapper extends Module {
val child = Module(new ModuleWire)
}

object ModuleSpec {
class Foo {
class Bar extends Module {
val io = IO(new Bundle{})
}
}
}

class ModuleSpec extends ChiselPropSpec {

property("ModuleVec should elaborate") {
Expand Down Expand Up @@ -158,4 +166,7 @@ class ModuleSpec extends ChiselPropSpec {
(the [Exception] thrownBy (Driver.elaborate(() => new NullModuleWrapper)))
.getMessage should include ("desiredName of chiselTests.NullModuleWrapper is null")
}
property("A default desiredName should be like getSimpleName") {
Driver.elaborate(() => {val foo = new ModuleSpec.Foo; new foo.Bar}).name should be ("Bar")
}
}

0 comments on commit 33334bc

Please sign in to comment.