mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-28 17:24:27 -05:00
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:
@@ -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")
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>CC785604-6277-4878-8DA9-360C47158E96</ProjectGuid>
|
||||
<RootNamespace>Microsoft.SqlTools.ServiceLayer.TestDriver</RootNamespace>
|
||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'==''">.\obj</BaseIntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'==''">.\bin\</OutputPath>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
</Project>
|
||||
Reference in New Issue
Block a user