diff options
| author | Jack Koenig | 2020-10-14 11:15:52 -0700 |
|---|---|---|
| committer | GitHub | 2020-10-14 18:15:52 +0000 |
| commit | baea2da820e9ebff5ba1b6ad9573a7cc33aaacbd (patch) | |
| tree | 5a4df10935adc353e7dd0ba0dbc74cdfc6068130 /src/test | |
| parent | fd92809eb3fa4497f38cfae4aa0e86106eb033c9 (diff) | |
Provide user source locators in Builder.error errors (#1618)
Package chisel3 was not properly marked as an internal package so source
locators in reported errors would point to files like Bits.scala.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/scala/chiselTests/stage/ChiselMainSpec.scala | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/scala/chiselTests/stage/ChiselMainSpec.scala b/src/test/scala/chiselTests/stage/ChiselMainSpec.scala index 0d400abd..679677d0 100644 --- a/src/test/scala/chiselTests/stage/ChiselMainSpec.scala +++ b/src/test/scala/chiselTests/stage/ChiselMainSpec.scala @@ -35,6 +35,11 @@ object ChiselMainSpec { require(false) } + /** A module that triggers a Builder.error (as opposed to exception) */ + class BuilderErrorModule extends RawModule { + val w = Wire(UInt(8.W)) + w(3, -1) + } } case class TestClassAspect() extends InspectorAspect[RawModule] ({ @@ -152,6 +157,14 @@ class ChiselMainSpec extends AnyFeatureSpec with GivenWhenThen with Matchers wit result = 1) ).foreach(runStageExpectFiles) } + Feature("Builder.error source locator") { + Seq( + ChiselMainTest(args = Array("-X", "none"), + generator = Some(classOf[BuilderErrorModule]), + stdout = Some("ChiselMainSpec.scala:41: Invalid bit range (3,-1) in class chiselTests.stage.ChiselMainSpec$BuilderErrorModule"), + result = 1) + ).foreach(runStageExpectFiles) + } Feature("Specifying a custom output file") { runStageExpectFiles(ChiselMainTest( |
