提交 f1dd1b88 编写于 作者: J Jared Parsons

Fix the UnitTest DLL names

上级 6a9d3aab
......@@ -16,8 +16,8 @@
<RunTestArgs Condition="'$(TestVsi)' == 'true'">$(RunTestArgs) -testVsi</RunTestArgs>
<RunTestArgs Condition="'$(Trait)' != ''">$(RunTestArgs) -trait:$(Trait)</RunTestArgs>
<RunTestArgs Condition="'$(NoTrait)' != ''">$(RunTestArgs) -notrait:$(NoTrait)</RunTestArgs>
<IncludePattern Condition="'$(IncludePattern)' == '' AND '$(TestVsi)' != 'true'">*.UnitTests*.dll</IncludePattern>
<IncludePattern Condition="'$(IncludePattern)' == '' AND '$(TestVsi)' == 'true'">*.IntegrationTests*.dll</IncludePattern>
<IncludePattern Condition="'$(IncludePattern)' == '' AND '$(TestVsi)' != 'true'">*.UnitTests.dll</IncludePattern>
<IncludePattern Condition="'$(IncludePattern)' == '' AND '$(TestVsi)' == 'true'">*.IntegrationTests.dll</IncludePattern>
<OutputDirectory>Binaries\$(Configuration)</OutputDirectory>
<NuGetPackageRoot>$(UserProfile)\.nuget\packages</NuGetPackageRoot>
<CoreClrTestDirectory>$(OutputDirectory)\CoreClrTest</CoreClrTestDirectory>
......
......@@ -280,18 +280,16 @@ private bool IsUnitTestCorrectlySpecified(TextWriter textWriter, RoslynProjectDa
}
var name = element.Value.Trim();
if (Regex.IsMatch(name, @"UnitTest(s?)\.dll", RegexOptions.IgnoreCase))
if (Regex.IsMatch(name, @"(UnitTests|IntegrationTests)$", RegexOptions.IgnoreCase) && !data.IsAnyUnitTest)
{
switch (data.EffectiveKind)
{
case RoslynProjectKind.UnitTest:
case RoslynProjectKind.UnitTestNext:
// This is correct
break;
default:
textWriter.WriteLine($"Assembly named {name} is not marked as a unit test");
return false;
}
textWriter.WriteLine($"Assembly named {name} is not marked as a unit test");
return false;
}
if (data.IsAnyUnitTest && !Regex.IsMatch(name, @".*(UnitTests|IntegrationTests)$", RegexOptions.IgnoreCase))
{
textWriter.WriteLine($"Assembly {name} is a unit test that doesn't end with UnitTests.dll");
return false;
}
return true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册