diff options
Diffstat (limited to 'src/test/scala/firrtlTests/PassTests.scala')
| -rw-r--r-- | src/test/scala/firrtlTests/PassTests.scala | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/test/scala/firrtlTests/PassTests.scala b/src/test/scala/firrtlTests/PassTests.scala index 7fa7e8ef..6727533e 100644 --- a/src/test/scala/firrtlTests/PassTests.scala +++ b/src/test/scala/firrtlTests/PassTests.scala @@ -9,6 +9,7 @@ import firrtl.ir.Circuit import firrtl.Parser.UseInfo import firrtl.passes.{Pass, PassExceptions, RemoveEmpty} import firrtl._ +import firrtl.annotations._ import logger._ // An example methodology for testing Firrtl Passes @@ -18,8 +19,9 @@ abstract class SimpleTransformSpec extends FlatSpec with FirrtlMatchers with Com def squash(c: Circuit): Circuit = RemoveEmpty.run(c) // Executes the test. Call in tests. - def execute(annotations: AnnotationMap, input: String, check: String): Unit = { - val finalState = compileAndEmit(CircuitState(parse(input), ChirrtlForm, Some(annotations))) + // annotations cannot have default value because scalatest trait Suite has a default value + def execute(input: String, check: String, annotations: Seq[Annotation]): Unit = { + val finalState = compileAndEmit(CircuitState(parse(input), ChirrtlForm, Some(AnnotationMap(annotations)))) val actual = RemoveEmpty.run(parse(finalState.getEmittedCircuit.value)).serialize val expected = parse(check).serialize logger.debug(actual) @@ -27,9 +29,10 @@ abstract class SimpleTransformSpec extends FlatSpec with FirrtlMatchers with Com (actual) should be (expected) } // Executes the test, should throw an error - def failingexecute(annotations: AnnotationMap, input: String): Exception = { + // No default to be consistent with execute + def failingexecute(input: String, annotations: Seq[Annotation]): Exception = { intercept[PassExceptions] { - compile(CircuitState(parse(input), ChirrtlForm, Some(annotations)), Seq.empty) + compile(CircuitState(parse(input), ChirrtlForm, Some(AnnotationMap(annotations))), Seq.empty) } } } |
