Merge branch 'master' into msbuilddll2
[mono.git] / mcs / class / Microsoft.Build.Tasks / Test / Microsoft.Build.Tasks / TestMessageLogger.cs
index 6b33fbe00660722c563edbd60d162a5a2a69b789..c6ca1a23901239cb1404143e2dc931d009ef10c0 100644 (file)
@@ -3,6 +3,7 @@ using System.Collections;
 using System;
 using System.Collections.Generic;
 using NUnit.Framework;
+using System.Text;
 
 namespace MonoTests.Microsoft.Build.Tasks
 {
@@ -128,6 +129,18 @@ namespace MonoTests.Microsoft.Build.Tasks
                        }
                }
 
+               public int WarningMessageCount {
+                       get {
+                               int count = 0, i = 0;
+                               while (i++ < messages.Count) {
+                                       var importance = messages [i - 1].Importance;
+                                       if (importance == MessageImportance.High)
+                                               count++;
+                               }
+                               return count;
+                       }
+               }
+
                public int CheckHead (string text, MessageImportance importance)
                {
                        string actual_msg;
@@ -190,6 +203,12 @@ namespace MonoTests.Microsoft.Build.Tasks
                                Console.WriteLine ("Msg: {0}", arg.Message);
                }
 
+               public void DumpMessages (StringBuilder sb)
+               {
+                       foreach (BuildEventArgs arg in all_messages)
+                               sb.AppendLine (string.Format ("Msg: {0}", arg.Message));
+               }
+
                public void CheckLoggedMessageHead (string expected, string id)
                {
                        string actual;