summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/scala/chiselTests/stage/ChiselMainSpec.scala13
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(