diff options
| author | Jim Lawson | 2019-01-26 14:40:00 -0800 |
|---|---|---|
| committer | Jack Koenig | 2019-01-26 14:40:00 -0800 |
| commit | cc33af7c31fd9b6fbc477781b840267e18acee0b (patch) | |
| tree | 8154b3785eed7ddd24f6d4ba013d3d6d2e818153 /src | |
| parent | 1738c1ef0ac95fae25d52586b3b0348de80de2ff (diff) | |
Use default test_run_dir for more DriverSpec tests. (#1006)
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/scala/firrtlTests/DriverSpec.scala | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/test/scala/firrtlTests/DriverSpec.scala b/src/test/scala/firrtlTests/DriverSpec.scala index 049547ac..545bf09a 100644 --- a/src/test/scala/firrtlTests/DriverSpec.scala +++ b/src/test/scala/firrtlTests/DriverSpec.scala @@ -28,6 +28,7 @@ object ExceptingTransform { //noinspection ScalaStyle class DriverSpec extends FreeSpec with Matchers with BackendCompilationUtilities { + val outputDir = createTestDirectory("DriverSpec") "CommonOptions are some simple options available across the chisel3 ecosystem" - { "CommonOption provide an scopt implementation of an OptionParser" - { "Options can be set from an Array[String] as is passed into a main" - { @@ -52,21 +53,23 @@ class DriverSpec extends FreeSpec with Matchers with BackendCompilationUtilities } } "CommonOptions can create a directory" in { - var dir = new java.io.File("a/b/c") + val top_dir = new java.io.File(outputDir, "a") + val dir = new java.io.File(top_dir, "b/c") if (dir.exists()) { dir.delete() } val optionsManager = new ExecutionOptionsManager("test") - optionsManager.parse(Array("--top-name", "dog", "--target-dir", "a/b/c")) should be(true) + val targetPath = dir.getPath + optionsManager.parse(Array("--top-name", "dog", "--target-dir", targetPath)) should be(true) val commonOptions = optionsManager.commonOptions commonOptions.topName should be("dog") - commonOptions.targetDirName should be("a/b/c") + commonOptions.targetDirName should be(targetPath) optionsManager.makeTargetDir() should be(true) - dir = new java.io.File("a/b/c") - dir.exists() should be(true) - FileUtils.deleteDirectoryHierarchy("a") should be(true) + val tdir = new java.io.File(targetPath) + tdir.exists() should be(true) + FileUtils.deleteDirectoryHierarchy(top_dir) should be(true) } } "options include by default a list of strings that are returned in commonOptions.programArgs" in { |
