diff options
| author | ducky | 2015-10-23 11:49:07 -0700 |
|---|---|---|
| committer | Palmer Dabbelt | 2015-10-23 13:21:22 -0700 |
| commit | 32a6322fc7e280e03f78a25fe3af92da516c5c7a (patch) | |
| tree | f93aa64998d4d3c11ac1babbd8abaeee25e86726 /src/test/scala/chiselTests/ChiselSpec.scala | |
| parent | da7162921544ca6265ee837b811f1eafb9b47208 (diff) | |
Add Scalaland unit tests for Reg
Diffstat (limited to 'src/test/scala/chiselTests/ChiselSpec.scala')
| -rw-r--r-- | src/test/scala/chiselTests/ChiselSpec.scala | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/test/scala/chiselTests/ChiselSpec.scala b/src/test/scala/chiselTests/ChiselSpec.scala index 03f057d4..2d546d00 100644 --- a/src/test/scala/chiselTests/ChiselSpec.scala +++ b/src/test/scala/chiselTests/ChiselSpec.scala @@ -8,10 +8,17 @@ import org.scalacheck._ import Chisel._ import Chisel.testers._ -class ChiselPropSpec extends PropSpec with PropertyChecks { +/** Common utility functions for Chisel unit tests. */ +trait ChiselRunners { def execute(t: => BasicTester): Boolean = TesterDriver.execute(t) def elaborate(t: => Module): Circuit = TesterDriver.elaborate(t) +} + +/** Spec base class for BDD-style testers. */ +class ChiselFlatSpec extends FlatSpec with ChiselRunners with Matchers +/** Spec base class for property-based testers. */ +class ChiselPropSpec extends PropSpec with ChiselRunners with PropertyChecks { def popCount(n: Long) = n.toBinaryString.count(_=='1') val smallPosInts = Gen.choose(1, 7) |
