aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala/firrtlTests/PassTests.scala
diff options
context:
space:
mode:
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 = {