diff options
| author | Albert Magyar | 2019-08-07 15:13:57 -0700 |
|---|---|---|
| committer | mergify[bot] | 2019-08-07 22:13:57 +0000 |
| commit | 23a104d3409385718a960427f1576f508e3f473b (patch) | |
| tree | 1bde53f80a0fe0f0c32eb0a1432f413989fd75b4 /src/test/scala/firrtlTests/InternalErrorSpec.scala | |
| parent | 0fe6aad23a4aee50119b9fe2645ba2ff833f65bb (diff) | |
DRY check chirrtl (#1148)
* Avoid redundancy between CheckChirrtl and CheckHighForm, add more checks
* Add test case for illegal Chirrtl memory in HighForm
Diffstat (limited to 'src/test/scala/firrtlTests/InternalErrorSpec.scala')
| -rw-r--r-- | src/test/scala/firrtlTests/InternalErrorSpec.scala | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/src/test/scala/firrtlTests/InternalErrorSpec.scala b/src/test/scala/firrtlTests/InternalErrorSpec.scala deleted file mode 100644 index 85c9c67d..00000000 --- a/src/test/scala/firrtlTests/InternalErrorSpec.scala +++ /dev/null @@ -1,46 +0,0 @@ -// See LICENSE for license details. - -package firrtlTests - -import java.io.File - -import firrtl._ -import firrtl.Utils.getThrowable -import firrtl.util.BackendCompilationUtilities -import org.scalatest.{FreeSpec, Matchers} - - -class InternalErrorSpec extends FreeSpec with Matchers with BackendCompilationUtilities { - "Unexpected exceptions" - { - val input = - """ - |circuit Dummy : - | module Dummy : - | input clock : Clock - | input x : UInt<1> - | output y : UInt<1> - | output io : { flip in : UInt<16>, out : UInt<16> } - | y <= shr(x, UInt(1)); this should generate an exception in PrimOps.scala:127. - | """.stripMargin - - var exception: Exception = null - "should throw a FIRRTLException" in { - val manager = new ExecutionOptionsManager("test") with HasFirrtlOptions { - commonOptions = CommonOptions(topName = "Dummy") - firrtlOptions = FirrtlExecutionOptions(firrtlSource = Some(input), compilerName = "low") - } - exception = intercept[FIRRTLException] { - firrtl.Driver.execute(manager) - } - } - - "should contain the expected string" in { - assert(exception.getMessage.contains("Internal Error! Please file an issue")) - } - - "should contain the name of the file originating the exception in the stack trace" in { - val first = true - assert(getThrowable(Some(exception), first).getStackTrace exists (_.getFileName.contains("PrimOps.scala"))) - } - } -} |
