Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManish Sinha <manish.sinha@xamarin.com>2015-08-25 20:00:21 +0300
committerManish Sinha <manish.sinha@xamarin.com>2015-08-25 20:27:56 +0300
commit64a82eb1406cca5028982ae1661c31f45c00f1e6 (patch)
tree85182aaab55dcf30e6508c9fac0405b5bcd16a7c /main/tests/UserInterfaceTests/LogMessageValidator.cs
parentcb630fd2d07267b5c521c017af640d160acfbdf1 (diff)
[UITest] Create a method to check if logs contain certain errors/warning
Diffstat (limited to 'main/tests/UserInterfaceTests/LogMessageValidator.cs')
-rw-r--r--main/tests/UserInterfaceTests/LogMessageValidator.cs49
1 files changed, 49 insertions, 0 deletions
diff --git a/main/tests/UserInterfaceTests/LogMessageValidator.cs b/main/tests/UserInterfaceTests/LogMessageValidator.cs
new file mode 100644
index 0000000000..3089c76271
--- /dev/null
+++ b/main/tests/UserInterfaceTests/LogMessageValidator.cs
@@ -0,0 +1,49 @@
+//
+// LogMessageValidator.cs
+//
+// Author:
+// Manish Sinha <manish.sinha@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.IO;
+using NUnit.Framework;
+using System.Collections.Generic;
+
+namespace UserInterfaceTests
+{
+ public class LogMessageValidator
+ {
+ static List<string> invalidLogStrings = new List<string> {
+ "Gtk-Critical: void gtk_container_remove(GtkContainer , GtkWidget )"
+ };
+
+ public static void Validate (string fileName)
+ {
+ var readIdeLog = File.ReadAllText (fileName);
+ foreach (var error in invalidLogStrings) {
+ Assert.IsFalse (readIdeLog.Contains (error),
+ string.Format ("GTK Error detected in Ide.log file:\n\t{0}",error));
+ }
+ }
+ }
+}
+