From 165634ea43d105563ee5a1ddddba01de986c33eb Mon Sep 17 00:00:00 2001 From: Charlie Poole Date: Tue, 19 Dec 2017 17:02:17 -0800 Subject: [PATCH] Use vswhere to find location of vstest.console.exe --- build.cake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/build.cake b/build.cake index 0599953..7d2a50a 100644 --- a/build.cake +++ b/build.cake @@ -1,3 +1,5 @@ +#tool nuget:?package=vswhere + ////////////////////////////////////////////////////////////////////// // ARGUMENTS ////////////////////////////////////////////////////////////////////// @@ -19,6 +21,10 @@ var NET35_ADAPTER_PATH = TOOLS_DIR + "NUnit3TestAdapter/build/net35/"; // Version of the Adapter to Use var ADAPTER_VERSION = "3.9.0"; +// Get path to VSTest +var VSTEST_CONSOLE = VSWhereLatest()?.CombineWithFilePath( + "./Common7/IDE/CommonExtensions/Microsoft/TestWindow/vstest.console.exe"); + // Specify all the demo projects var DemoProjects = new DemoProject[] { new DemoProject() @@ -152,7 +158,7 @@ Task("RunDemos") IEnumerable redirectedErrorOutput; int result = StartProcess( - "vstest.console.exe", + VSTEST_CONSOLE, new ProcessSettings() { Arguments = $"{proj.TestAssembly} /TestAdapterPath:{NET35_ADAPTER_PATH}",