diff --git a/BuildAndTest.proj b/BuildAndTest.proj
index 747d48fa67c49d41b8c325275db1aed549e7c6a8..e8170649afc377e65de67bb167f38ec2208f67ef 100644
--- a/BuildAndTest.proj
+++ b/BuildAndTest.proj
@@ -16,8 +16,8 @@
$(RunTestArgs) -testVsi
$(RunTestArgs) -trait:$(Trait)
$(RunTestArgs) -notrait:$(NoTrait)
- *.UnitTests*.dll
- *.IntegrationTests*.dll
+ *.UnitTests.dll
+ *.IntegrationTests.dll
Binaries\$(Configuration)
$(UserProfile)\.nuget\packages
$(OutputDirectory)\CoreClrTest
diff --git a/src/Tools/BuildBoss/ProjectCheckerUtil.cs b/src/Tools/BuildBoss/ProjectCheckerUtil.cs
index 1a56dc45e8b857329073bb1e280497dab4f8a60f..b1bc83a96a35132b4e5ef589e808f0699b2edb50 100644
--- a/src/Tools/BuildBoss/ProjectCheckerUtil.cs
+++ b/src/Tools/BuildBoss/ProjectCheckerUtil.cs
@@ -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;