From 67e49d363695bddb53e152d42f12920504338c5d Mon Sep 17 00:00:00 2001 From: Kiran Challa Date: Tue, 23 Feb 2016 14:10:17 -0800 Subject: [PATCH] Enable passing in 'parallel' parameter to dotnet test --- KoreBuild-dotnet/build/_dotnet-test.shade | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/KoreBuild-dotnet/build/_dotnet-test.shade b/KoreBuild-dotnet/build/_dotnet-test.shade index d8a95c021b..93f440a349 100644 --- a/KoreBuild-dotnet/build/_dotnet-test.shade +++ b/KoreBuild-dotnet/build/_dotnet-test.shade @@ -18,7 +18,16 @@ default configuration = 'Debug' @{ var projectFolder = Path.GetDirectoryName(projectFile); - var testArgs = "--configuration " + configuration; - Dotnet("test " + testArgs, projectFolder); + var projectName = Path.GetFileName(projectFolder); + + var noParallelTestProjects = new HashSet(StringComparer.OrdinalIgnoreCase); + if (!string.IsNullOrEmpty(NO_PARALLEL_TEST_PROJECTS)) + { + noParallelTestProjects.UnionWith(NO_PARALLEL_TEST_PROJECTS.Split((char)',')); + } + + var testArgs = " --configuration " + configuration; + testArgs += noParallelTestProjects.Contains(projectName) || IsLinux ? " -parallel none" : ""; + Dotnet("test" + testArgs, projectFolder); }