From 32af1d4fafc64ddb669b313e627b2e3a308dc1ab Mon Sep 17 00:00:00 2001 From: Chick Markley Date: Wed, 1 Feb 2017 20:43:21 -0800 Subject: Fix anno in backend (#428) * fixed up impementation of deleteDirectoryHierarchy Added a few more tests * Round 2 of moving verilog to target dir Only create .f file if some files have been moved Some small style fixes in Driver Restored lost functionality to add -f argument in verilogToCpp Fixed loadAnnotations to add targetDir regardless of annotations arriving from file or through options --- src/test/scala/firrtlTests/DriverSpec.scala | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/test') diff --git a/src/test/scala/firrtlTests/DriverSpec.scala b/src/test/scala/firrtlTests/DriverSpec.scala index 5bed2a2b..4e1add39 100644 --- a/src/test/scala/firrtlTests/DriverSpec.scala +++ b/src/test/scala/firrtlTests/DriverSpec.scala @@ -49,7 +49,7 @@ class DriverSpec extends FreeSpec with Matchers with BackendCompilationUtilities optionsManager.makeTargetDir() should be (true) dir = new java.io.File("a/b/c") dir.exists() should be (true) - FileUtils.deleteDirectoryHierarchy(commonOptions.targetDirName) + FileUtils.deleteDirectoryHierarchy("a") should be (true) } } } @@ -173,4 +173,17 @@ class DriverSpec extends FreeSpec with Matchers with BackendCompilationUtilities } } } + + "Directory deleter is handy for cleaning up after tests" - { + "for example making a directory tree, and deleting it looks like" in { + FileUtils.makeDirectory("dog/fox/wolf") + val dir = new File("dog/fox/wolf") + dir.exists() should be (true) + dir.isDirectory should be (true) + + FileUtils.deleteDirectoryHierarchy("wolf") should be (false) + FileUtils.deleteDirectoryHierarchy("dog") should be (true) + dir.exists() should be (false) + } + } } -- cgit v1.2.3