提交 4cb1ebc2 编写于 作者: J Jared Parsons

Fix some portable test issues

上级 0301600e
......@@ -13,7 +13,7 @@
<OutDir>$(OutDir)UnitTests\$(MSBuildProjectName)\</OutDir>
</PropertyGroup>
</When>
<When Condition="'$(RoslynProjectType)' == 'UnitTestPortable'">
<When Condition="'$(RoslynProjectType)' == 'UnitTestPortable' or '$(RoslynProjectType)' == 'UnitTestDesktop'">
<PropertyGroup>
<_CopyReferences>false</_CopyReferences>
<_CopyProjectReferences>false</_CopyProjectReferences>
......
......@@ -14,7 +14,7 @@
<TargetFrameworkProfile></TargetFrameworkProfile>
<TargetFrameworkIdentifier>.NETPortable</TargetFrameworkIdentifier>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<RoslynProjectType>UnitTest</RoslynProjectType>
<RoslynProjectType>UnitTestDesktop</RoslynProjectType>
</PropertyGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\Compilers\Core\Portable\CodeAnalysis.csproj">
......
......@@ -11,7 +11,7 @@
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
<TargetFrameworkIdentifier>.NETPortable</TargetFrameworkIdentifier>
<ProjectTypeGuids>{14182A97-F7F0-4C62-8B27-98AA8AE2109A};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids>
<RoslynProjectType>UnitTest</RoslynProjectType>
<RoslynProjectType>UnitTestDesktop</RoslynProjectType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "></PropertyGroup>
......
......@@ -58,10 +58,18 @@
<Project>{12a68549-4e8c-42d6-8703-a09335f97997}</Project>
<Name>Scripting</Name>
</ProjectReference>
<ProjectReference Include="..\..\Scripting\CSharpTest\CSharpScriptingTest.csproj">
<Project>{2dae4406-7a89-4b5f-95c3-bc5422ce47ce}</Project>
<Name>CSharpScriptingTest</Name>
</ProjectReference>
<ProjectReference Include="..\..\Scripting\CSharp\CSharpScripting.csproj">
<Project>{066f0dbd-c46c-4c20-afec-99829a172625}</Project>
<Name>CSharpScripting</Name>
</ProjectReference>
<ProjectReference Include="..\..\Scripting\VisualBasicTest\BasicScriptingTest.vbproj">
<Project>{abc7262e-1053-49f3-b846-e3091bb92e8c}</Project>
<Name>BasicScriptingTest</Name>
</ProjectReference>
<ProjectReference Include="..\..\Scripting\VisualBasic\BasicScripting.vbproj">
<Project>{3e7dea65-317b-4f43-a25d-62f18d96cfd7}</Project>
<Name>BasicScripting</Name>
......@@ -76,4 +84,4 @@
</ProjectReference>
</ItemGroup>
<Import Project="..\..\..\build\Targets\Imports.targets" />
</Project>
</Project>
\ No newline at end of file
......@@ -304,7 +304,9 @@ private bool IsUnitTestCorrectlySpecified(TextWriter textWriter, RoslynProjectDa
private bool CheckTestDeploymentProjects(TextWriter textWriter)
{
var fileName = Path.GetFileNameWithoutExtension(_data.FileName);
if (fileName != "DeployCoreClrTestRuntime" && fileName != "DeployDesktopTestRuntime")
var isDesktop = fileName == "DeployDesktopTestRuntime";
var isCoreClr = fileName == "DeployCoreClrTestRuntime";
if (!isDesktop && !isCoreClr)
{
return true;
}
......@@ -321,7 +323,27 @@ private bool CheckTestDeploymentProjects(TextWriter textWriter)
foreach (var projectData in _solutionMap.Values)
{
var rosData = projectData.ProjectUtil.TryGetRoslynProjectData();
if (rosData?.DeclaredKind == RoslynProjectKind.UnitTestPortable && !set.Contains(projectData.Key))
if (rosData == null)
{
continue;
}
var kind = rosData.Value.DeclaredKind;
bool include;
switch (kind)
{
case RoslynProjectKind.UnitTestPortable:
include = true;
break;
case RoslynProjectKind.UnitTestDesktop:
include = isDesktop;
break;
default:
include = false;
break;
}
if (include && !set.Contains(projectData.Key))
{
textWriter.WriteLine($"Portable unit test {projectData.FileName} must be referenced");
allGood = false;
......
......@@ -13,7 +13,7 @@ internal enum RoslynProjectKind
Exe,
ExeCoreClr,
UnitTest,
UnitTestNext,
UnitTestDesktop,
UnitTestPortable,
CompilerGeneratorTool,
DeploymentCompilerGeneratorTools,
......@@ -38,6 +38,8 @@ internal static class RoslynProjectKindUtil
return RoslynProjectKind.Exe;
case "UnitTestPortable":
return RoslynProjectKind.UnitTestPortable;
case "UnitTestDesktop":
return RoslynProjectKind.UnitTestDesktop;
case "UnitTest":
return RoslynProjectKind.UnitTest;
case "CompilerGeneratorTool":
......@@ -63,6 +65,7 @@ internal static bool IsAnyUnitTest(RoslynProjectKind kind)
{
return
kind == RoslynProjectKind.UnitTest ||
kind == RoslynProjectKind.UnitTestDesktop ||
kind == RoslynProjectKind.UnitTestPortable;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册