Adding TestDriver project and CodeCoverage folder to the main solution (#133)

This will make it much easier for Visual Studio users to validate the TestDriver project.

* Adding TestDriver project and CodeCoverage folder to the main solution

* Adding fallback value for service layer exe path to allow tests to run in Visual Studio
This commit is contained in:
Benjamin Russell
2016-11-07 15:08:53 -08:00
committed by GitHub
parent 3d8eefa685
commit 3808dcdafd
3 changed files with 53 additions and 8 deletions

View File

@@ -28,15 +28,9 @@ namespace Microsoft.SqlTools.ServiceLayer.TestDriver.Driver
public const string CodeCoverageToolEnvironmentVariable = "CODECOVERAGETOOL";
public const string CodeCoverageOutputEnvironmentVariable = "CODECOVERAGEOUTPUT";
public const string CodeCoverageOutputEnvironmentVariable = "CODECOVERAGEOUTPUT";
/// <summary>
/// Environment variable that stores the path to the service host executable.
/// </summary>
public static string ServiceHostEnvironmentVariable
{
get { return "SQLTOOLSSERVICE_EXE"; }
}
public const string ServiceHostEnvironmentVariable = "SQLTOOLSSERVICE_EXE";
public bool IsCoverageRun { get; set; }
@@ -44,6 +38,19 @@ namespace Microsoft.SqlTools.ServiceLayer.TestDriver.Driver
{
string serviceHostExecutable = Environment.GetEnvironmentVariable(ServiceHostEnvironmentVariable);
string serviceHostArguments = "--enable-logging";
if (string.IsNullOrWhiteSpace(serviceHostExecutable))
{
// Include a fallback value to for running tests within visual studio
serviceHostExecutable =
@"..\..\src\Microsoft.SqlTools.ServiceLayer\bin\Debug\netcoreapp1.0\win7-x64\Microsoft.SqlTools.ServiceLayer.exe";
}
// Make sure it exists before continuing
if (!File.Exists(serviceHostExecutable))
{
throw new FileNotFoundException($"Failed to find Microsoft.SqlTools.ServiceLayer.exe at provided location '{serviceHostExecutable}'. " +
"Please set SQLTOOLSERVICE_EXE environment variable to location of exe");
}
//setup the service host for code coverage if the envvar is enabled
if (Environment.GetEnvironmentVariable(ServiceCodeCoverageEnvironmentVariable) == "True")