From b1785f7ae137f1d546a3128ad32d171aabb6c3af Mon Sep 17 00:00:00 2001 From: Faizan Ahmad Date: Wed, 23 Nov 2016 12:24:45 +0530 Subject: [PATCH 1/3] Dont pass AnyCPU to vstest.console --- src/Microsoft.TestPlatform.Build/Tasks/VSTestTask.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.TestPlatform.Build/Tasks/VSTestTask.cs b/src/Microsoft.TestPlatform.Build/Tasks/VSTestTask.cs index 4071a93efd..6b182133d2 100644 --- a/src/Microsoft.TestPlatform.Build/Tasks/VSTestTask.cs +++ b/src/Microsoft.TestPlatform.Build/Tasks/VSTestTask.cs @@ -101,7 +101,7 @@ private IEnumerable CreateArgument() allArgs.Add("--framework:" + this.AddDoubleQuotes(this.VSTestFramework)); } - if (!string.IsNullOrEmpty(this.VSTestPlatform)) + if (!string.IsNullOrEmpty(this.VSTestPlatform) && !this.VSTestPlatform.Contains("AnyCPU")) { allArgs.Add("--platform:" + this.VSTestPlatform); } From 26f535e57f30025bddd0e84da66fa61261baea6b Mon Sep 17 00:00:00 2001 From: Faizan Ahmad Date: Wed, 23 Nov 2016 13:56:46 +0530 Subject: [PATCH 2/3] Added comment --- src/Microsoft.TestPlatform.Build/Tasks/VSTestTask.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Microsoft.TestPlatform.Build/Tasks/VSTestTask.cs b/src/Microsoft.TestPlatform.Build/Tasks/VSTestTask.cs index 6b182133d2..5836c0675b 100644 --- a/src/Microsoft.TestPlatform.Build/Tasks/VSTestTask.cs +++ b/src/Microsoft.TestPlatform.Build/Tasks/VSTestTask.cs @@ -101,6 +101,7 @@ private IEnumerable CreateArgument() allArgs.Add("--framework:" + this.AddDoubleQuotes(this.VSTestFramework)); } + // vstest.console only support x86 and x64 for argument platform if (!string.IsNullOrEmpty(this.VSTestPlatform) && !this.VSTestPlatform.Contains("AnyCPU")) { allArgs.Add("--platform:" + this.VSTestPlatform); From 4db95627cbc8a5b15e53a30c4764b36630c3463b Mon Sep 17 00:00:00 2001 From: Faizan Ahmad Date: Wed, 23 Nov 2016 17:37:29 +0530 Subject: [PATCH 3/3] Fix for issue https://github.com/Microsoft/vstest/issues/241 --- .../Tasks/{PrintBuildStartEndTask.cs => BuildLogTask.cs} | 0 src/Microsoft.TestPlatform.Build/Tasks/VSTestTask.cs | 5 +++-- 2 files changed, 3 insertions(+), 2 deletions(-) rename src/Microsoft.TestPlatform.Build/Tasks/{PrintBuildStartEndTask.cs => BuildLogTask.cs} (100%) diff --git a/src/Microsoft.TestPlatform.Build/Tasks/PrintBuildStartEndTask.cs b/src/Microsoft.TestPlatform.Build/Tasks/BuildLogTask.cs similarity index 100% rename from src/Microsoft.TestPlatform.Build/Tasks/PrintBuildStartEndTask.cs rename to src/Microsoft.TestPlatform.Build/Tasks/BuildLogTask.cs diff --git a/src/Microsoft.TestPlatform.Build/Tasks/VSTestTask.cs b/src/Microsoft.TestPlatform.Build/Tasks/VSTestTask.cs index 5836c0675b..cf8cd55ff2 100644 --- a/src/Microsoft.TestPlatform.Build/Tasks/VSTestTask.cs +++ b/src/Microsoft.TestPlatform.Build/Tasks/VSTestTask.cs @@ -72,8 +72,9 @@ public override bool Execute() { Console.WriteLine("Test run for {0}({1})", this.TestFileFullPath, this.VSTestFramework); } - vsTestForwardingApp.Execute(); - return true; + + int returnCode = vsTestForwardingApp.Execute(); + return returnCode == 0 ? true : false; } private string AddDoubleQuotes(string x)