diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/scala/chiselTests/DriverSpec.scala | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/test/scala/chiselTests/DriverSpec.scala b/src/test/scala/chiselTests/DriverSpec.scala index 8fc58e21..75ab93ae 100644 --- a/src/test/scala/chiselTests/DriverSpec.scala +++ b/src/test/scala/chiselTests/DriverSpec.scala @@ -17,7 +17,13 @@ class DummyModule extends Module { io.out := io.in } -class DriverSpec extends FreeSpec with Matchers { +class TypeErrorModule extends chisel3.experimental.MultiIOModule { + val in = IO(Input(UInt(1.W))) + val out = IO(Output(SInt(1.W))) + out := in +} + +class DriverSpec extends FreeSpec with Matchers with chiselTests.Utils { "Driver's execute methods are used to run chisel and firrtl" - { "options can be picked up from comand line with no args" in { // NOTE: Since we don't provide any arguments (notably, "--target-dir"), @@ -73,5 +79,21 @@ class DriverSpec extends FreeSpec with Matchers { dummyOutput.exists() should be(true) dummyOutput.delete() } + + "user errors show a trimmed stack trace" in { + val targetDir = "test_run_dir" + val args = Array("--compiler", "low", "--target-dir", targetDir) + + val (stdout, stderr, result) = grabStdOutErr { Driver.execute(args, () => new TypeErrorModule) } + + info("stdout shows a trimmed stack trace") + stdout should include ("Stack trace trimmed to user code only") + + info("stdout does not include FIRRTL information") + stdout should not include ("firrtl.") + + info("Driver returned a ChiselExecutionFailure") + result shouldBe a [ChiselExecutionFailure] + } } } |
