From 16f3dbda5c3868419cf78d4d83133cd34adf3303 Mon Sep 17 00:00:00 2001 From: albertchen-sifive Date: Mon, 1 Oct 2018 17:23:34 -0700 Subject: add BlackBoxPathAnno (#903) --- .../transforms/BlacklBoxSourceHelperSpec.scala | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'src/test') diff --git a/src/test/scala/firrtlTests/transforms/BlacklBoxSourceHelperSpec.scala b/src/test/scala/firrtlTests/transforms/BlacklBoxSourceHelperSpec.scala index 455ceb3f..7daebf21 100644 --- a/src/test/scala/firrtlTests/transforms/BlacklBoxSourceHelperSpec.scala +++ b/src/test/scala/firrtlTests/transforms/BlacklBoxSourceHelperSpec.scala @@ -49,6 +49,45 @@ class BlacklBoxSourceHelperTransformSpec extends LowTransformSpec { | a1.foo <= x """.stripMargin + "annotated external modules with absolute path" should "appear in output directory" in { + + val absPath = new java.io.File("src/test/resources/blackboxes/AdderExtModule.v").getCanonicalPath + val annos = Seq( + BlackBoxTargetDirAnno("test_run_dir"), + BlackBoxPathAnno(moduleName, absPath) + ) + + execute(input, output, annos) + + val module = new java.io.File("test_run_dir/AdderExtModule.v") + val fileList = new java.io.File(s"test_run_dir/${BlackBoxSourceHelper.fileListName}") + + module.exists should be (true) + fileList.exists should be (true) + + module.delete() + fileList.delete() + } + + "annotated external modules with relative path" should "appear in output directory" in { + + val annos = Seq( + BlackBoxTargetDirAnno("test_run_dir"), + BlackBoxPathAnno(moduleName, "src/test/resources/blackboxes/AdderExtModule.v") + ) + + execute(input, output, annos) + + val module = new java.io.File("test_run_dir/AdderExtModule.v") + val fileList = new java.io.File(s"test_run_dir/${BlackBoxSourceHelper.fileListName}") + + module.exists should be (true) + fileList.exists should be (true) + + module.delete() + fileList.delete() + } + "annotated external modules" should "appear in output directory" in { val annos = Seq( -- cgit v1.2.3