[TestFixture]
public class TaskBatchingTest
{
+ string projectHeader;
+ public TaskBatchingTest ()
+ {
+ projectHeader = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" " + Consts.ToolsVersionString + ">";
+ }
+
[Test]
public void Test1 ()
{
CheckLoggedMessageAny (testLogger, "Number: 2 Color: Red-- Items in ExampColl: ExampColl2: Item5", "A3");
CheckLoggedMessageAny (testLogger, "Number: 3 Color: Green-- Items in ExampColl: ExampColl2: Item6", "A4");
CheckLoggedMessageAny (testLogger, "Number: 2 Color: -- Items in ExampColl: Item2 ExampColl2: ", "A5");
- Assert.AreEqual (0, testLogger.Count, "A6");
+ Assert.AreEqual (0, testLogger.NormalMessageCount, "A6");
+ Assert.AreEqual (0, testLogger.WarningMessageCount, "A7");
CheckEngineEventCounts (testLogger, 1, 1, 4, 4);
}
CheckLoggedMessageAny (testLogger, "Identity: Item4 -- Items in ExampColl: Item4;Item4", "A5");
CheckLoggedMessageAny (testLogger, "Identity: Item5 -- Items in ExampColl: Item5", "A6");
CheckLoggedMessageAny (testLogger, "Identity: Item6 -- Items in ExampColl: Item6", "A7");
- Assert.AreEqual (0, testLogger.Count, "A8");
+ Assert.AreEqual (0, testLogger.NormalMessageCount, "A8");
+ Assert.AreEqual (0, testLogger.WarningMessageCount, "A7");
CheckEngineEventCounts (testLogger, 1, 1, 6, 6);
}
// batching should happen only on basis of the task attributes,
// and not the resolved expression values
public void TestBatching1 () {
- string projectString = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">
+ string projectString = projectHeader + @"
<ItemGroup>
<item3 Include=""foo""/>
<item2 Include=""%(item3.Identity)""/>
// batching should happen only on basis of the task attributes,
// and not the resolved expression values
public void TestConditionalBatching2 () {
- string projectString = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">
+ string projectString = projectHeader + @"
<ItemGroup>
<item2 Include=""%(item3.Identity)""/>
<item4 Include=""%(item2.Identity);@(item3)""/>
[Test]
public void TestBatchingWithUnbatchedItems () {
- string projectString = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">
+ string projectString = projectHeader + @"
<ItemGroup>
<Item1 Include=""One""/>
<Item1 Include=""Two""/>
[Test]
public void TestPropertiesWithBatchedReferences () {
- string projectString = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">
+ string projectString = projectHeader + @"
<ItemGroup>
<Item1 Include=""One""/>
<Item1 Include=""Two""/>
[Test]
public void TestPropertiesWithDynamicItems () {
- string projectString = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">
+ string projectString = projectHeader + @"
<ItemGroup>
<Item1 Include=""One""/>
<Item1 Include=""Two""/>
[Test]
public void TestTargetInvocationFromBatchedTask () {
- string projectString = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">
+ string projectString = projectHeader + @"
<ItemGroup>
<Item1 Include=""One""/>
<Item1 Include=""Two""/>
[Test]
public void TestTargetInvocationFromBatchedTarget () {
- string projectString = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">
+ string projectString = projectHeader + @"
<ItemGroup>
<Item1 Include=""One""/>
<Item1 Include=""Two""/>
[Test]
public void TestBatchingWithUnqualifiedMetadataReference () {
- string projectString = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">
+ string projectString = projectHeader + @"
<ItemGroup>
<Item1 Include=""One""><Md>1</Md></Item1>
<Item1 Include=""Two""><Md>2</Md></Item1>
testLogger.DumpMessages ();
Assert.Fail ("Build failed");
}
- testLogger.DumpMessages ();
try {
testLogger.CheckLoggedAny ("For md: 3 Item1: Item1Ref: Item2: Three Item2Ref: Three Prop1: Prop1Ref: Prop2: Three Prop2Ref: Three", MessageImportance.Normal, "A1");