diff options
| author | chick | 2019-08-01 09:21:52 -0700 |
|---|---|---|
| committer | chick | 2019-08-01 10:52:22 -0700 |
| commit | 54e67889f10b39323fb729808b8cd22b4c832910 (patch) | |
| tree | 4b5916fe8e6cee619ab5dfc3549bfb625b5b8214 /src/test/scala/firrtlTests/DriverSpec.scala | |
| parent | 86d2470d8294a4dba37d33ba021558ba33da4d65 (diff) | |
Followup to PR #1142
Fixes a threading bug in where lazy reading of file
caused a problem for multithreaded access to the that was read.
Changes all uses of io.Source to use new API
getText
getLines
getTextResource
getLinesResouce
Make style to only import FileUtils and not its methods
So code is more explicit as e.g. FileUtils.getText()
Diffstat (limited to 'src/test/scala/firrtlTests/DriverSpec.scala')
| -rw-r--r-- | src/test/scala/firrtlTests/DriverSpec.scala | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/test/scala/firrtlTests/DriverSpec.scala b/src/test/scala/firrtlTests/DriverSpec.scala index 1cb991c8..b4f61dfd 100644 --- a/src/test/scala/firrtlTests/DriverSpec.scala +++ b/src/test/scala/firrtlTests/DriverSpec.scala @@ -9,10 +9,10 @@ import firrtl.passes.{InlineAnnotation, InlineInstances} import firrtl.passes.memlib.{InferReadWrite, InferReadWriteAnnotation, ReplSeqMem, ReplSeqMemAnnotation} import firrtl.transforms.BlackBoxTargetDirAnno import firrtl._ +import firrtl.FileUtils import firrtl.annotations._ import firrtl.util.BackendCompilationUtilities -import scala.io.Source import scala.util.{Failure, Success, Try} class ExceptingTransform extends Transform { @@ -307,7 +307,7 @@ class DriverSpec extends FreeSpec with Matchers with BackendCompilationUtilities copyResourceToFile(s"/annotations/$annoFilename", annotationsTestFile) import net.jcazevedo.moultingyaml._ - val text = io.Source.fromFile(annotationsTestFile).mkString + val text = FileUtils.getText(annotationsTestFile) val yamlAnnos = text.parseYaml match { case YamlArray(xs) => xs } @@ -467,8 +467,8 @@ class DriverSpec extends FreeSpec with Matchers with BackendCompilationUtilities Driver.execute(args) } "Both paths do the same thing" in { - val s1 = Source.fromFile(verilogFromFir).mkString - val s2 = Source.fromFile(verilogFromPb).mkString + val s1 = FileUtils.getText(verilogFromFir) + val s2 = FileUtils.getText(verilogFromPb) s1 should equal (s2) } } |
