diff options
Diffstat (limited to 'src/test/scala/firrtlTests/AnnotationTests.scala')
| -rw-r--r-- | src/test/scala/firrtlTests/AnnotationTests.scala | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/test/scala/firrtlTests/AnnotationTests.scala b/src/test/scala/firrtlTests/AnnotationTests.scala index 3e93081e..aeefbbe3 100644 --- a/src/test/scala/firrtlTests/AnnotationTests.scala +++ b/src/test/scala/firrtlTests/AnnotationTests.scala @@ -23,13 +23,13 @@ trait AnnotationSpec extends LowTransformSpec { def transform = new ResolveAndCheck // Check if Annotation Exception is thrown - override def failingexecute(annotations: AnnotationMap, input: String): Exception = { + override def failingexecute(input: String, annotations: Seq[Annotation]): Exception = { intercept[AnnotationException] { - compile(CircuitState(parse(input), ChirrtlForm, Some(annotations)), Seq.empty) + compile(CircuitState(parse(input), ChirrtlForm, Some(AnnotationMap(annotations))), Seq.empty) } } - def execute(aMap: Option[AnnotationMap], input: String, check: Annotation): Unit = { - val cr = compile(CircuitState(parse(input), ChirrtlForm, aMap), Seq.empty) + def execute(input: String, check: Annotation, annotations: Seq[Annotation]): Unit = { + val cr = compile(CircuitState(parse(input), ChirrtlForm, Some(AnnotationMap(annotations))), Seq.empty) cr.annotations.get.annotations should contain (check) } } @@ -49,13 +49,6 @@ class AnnotationTests extends AnnotationSpec with Matchers { Annotation(ComponentName(s, ModuleName(mod, CircuitName("Top"))), classOf[Transform], value) def manno(mod: String): Annotation = Annotation(ModuleName(mod, CircuitName("Top")), classOf[Transform], "some value") - // TODO unify with FirrtlMatchers, problems with multiple definitions of parse - def dontTouch(path: String): Annotation = { - val parts = path.split('.') - require(parts.size >= 2, "Must specify both module and component!") - val name = ComponentName(parts.tail.mkString("."), ModuleName(parts.head, CircuitName("Top"))) - DontTouchAnnotation(name) - } "Loose and Sticky annotation on a node" should "pass through" in { val input: String = @@ -65,7 +58,7 @@ class AnnotationTests extends AnnotationSpec with Matchers { | input b : UInt<1> | node c = b""".stripMargin val ta = anno("c", "") - execute(getAMap(ta), input, ta) + execute(input, ta, Seq(ta)) } "Annotations" should "be readable from file" in { |
