aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala/firrtlTests/PassTests.scala
diff options
context:
space:
mode:
authorAbert Chen2019-07-19 09:01:57 -0700
committerSchuyler Eldridge2019-09-12 12:41:58 -0400
commit750ee776978fa1fdcfa64aa04f218b0c70c3e85e (patch)
tree0f2f13ead2a12d919809c71be891043fcb34d2bd /src/test/scala/firrtlTests/PassTests.scala
parent7929768a99eb93eea1c1ff0f71ab7d16a59abaa0 (diff)
update inline transform and testcases
Diffstat (limited to 'src/test/scala/firrtlTests/PassTests.scala')
-rw-r--r--src/test/scala/firrtlTests/PassTests.scala14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/scala/firrtlTests/PassTests.scala b/src/test/scala/firrtlTests/PassTests.scala
index 6f94275e..7fe154ec 100644
--- a/src/test/scala/firrtlTests/PassTests.scala
+++ b/src/test/scala/firrtlTests/PassTests.scala
@@ -29,6 +29,20 @@ abstract class SimpleTransformSpec extends FlatSpec with FirrtlMatchers with Com
(actual) should be (expected)
finalState
}
+
+ def executeWithAnnos(input: String, check: String, annotations: Seq[Annotation],
+ checkAnnotations: Seq[Annotation]): CircuitState = {
+ val finalState = compileAndEmit(CircuitState(parse(input), ChirrtlForm, annotations))
+ val actual = RemoveEmpty.run(parse(finalState.getEmittedCircuit.value)).serialize
+ val expected = parse(check).serialize
+ logger.debug(actual)
+ logger.debug(expected)
+ (actual) should be (expected)
+ checkAnnotations.foreach { check =>
+ (finalState.annotations.toSeq) should contain (check)
+ }
+ finalState
+ }
// Executes the test, should throw an error
// No default to be consistent with execute
def failingexecute(input: String, annotations: Seq[Annotation]): Exception = {