From 2a92c5d92c774b283165baaf6bd92a806710314f Mon Sep 17 00:00:00 2001 From: Qi Wang Date: Mon, 1 Oct 2018 16:00:49 -0400 Subject: [PATCH] apply system properties to all test framworks --- .../src/main/scala/bloop/engine/tasks/Tasks.scala | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/frontend/src/main/scala/bloop/engine/tasks/Tasks.scala b/frontend/src/main/scala/bloop/engine/tasks/Tasks.scala index ad689b1cb7..35e20402e1 100644 --- a/frontend/src/main/scala/bloop/engine/tasks/Tasks.scala +++ b/frontend/src/main/scala/bloop/engine/tasks/Tasks.scala @@ -142,10 +142,18 @@ object Tasks { List(Config.TestArgument(rawArgs, Some(Config.TestFramework(List(cls))))) case frameworks => val frameworkNames = foundFrameworks(frameworks) - val ignoredArgs = frameworkSpecificRawArgs.mkString(" ") - logger.warn( + val (sysProperties, ignoredArgs) = frameworkSpecificRawArgs.partition(s => s.startsWith("-D")) + + if(ignoredArgs.nonEmpty) + logger.warn( s"Ignored CLI test options '${ignoredArgs}' can only be applied to one framework, found: $frameworkNames") - Nil + + val cls = frameworks.map(f => f.getClass.getName) + + if(sysProperties.isEmpty) + Nil + else + List(Config.TestArgument(sysProperties, Some(Config.TestFramework(cls)))) } } }