diff options
Diffstat (limited to 'src/test/scala/firrtlTests/MultiThreadingSpec.scala')
| -rw-r--r-- | src/test/scala/firrtlTests/MultiThreadingSpec.scala | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/test/scala/firrtlTests/MultiThreadingSpec.scala b/src/test/scala/firrtlTests/MultiThreadingSpec.scala index c7b18624..6ec1a2bd 100644 --- a/src/test/scala/firrtlTests/MultiThreadingSpec.scala +++ b/src/test/scala/firrtlTests/MultiThreadingSpec.scala @@ -24,7 +24,8 @@ class MultiThreadingSpec extends FirrtlPropSpec { new firrtl.HighFirrtlCompiler, new firrtl.MiddleFirrtlCompiler, new firrtl.LowFirrtlCompiler, - new firrtl.VerilogCompiler) + new firrtl.VerilogCompiler + ) val inputFilePath = s"/integration/GCDTester.fir" // arbitrary val numThreads = 64 // arbitrary @@ -35,20 +36,20 @@ class MultiThreadingSpec extends FirrtlPropSpec { import ExecutionContext.Implicits.global try { // Use try-catch because error can manifest in many ways // Execute for each compiler - val compilerResults = compilers map { compiler => + val compilerResults = compilers.map { compiler => // Run compiler serially once val serialResult = runCompiler(inputStrings, compiler) Future { - val threadFutures = (0 until numThreads) map { i => - Future { - runCompiler(inputStrings, compiler) == serialResult - } + val threadFutures = (0 until numThreads).map { i => + Future { + runCompiler(inputStrings, compiler) == serialResult } + } Await.result(Future.sequence(threadFutures), Duration.Inf) } } val results = Await.result(Future.sequence(compilerResults), Duration.Inf) - assert(results.flatten reduce (_ && _)) // check all true (ie. success) + assert(results.flatten.reduce(_ && _)) // check all true (ie. success) } catch { case _: Throwable => fail("The Compiler is not thread safe") } |
