[mono/monodevelop] 37631de0: [TestRunner] Cleanup in Runner.cs

"Therzok ([email protected])" <[email protected]>
Newsgroups gmane.comp.gnome.mono.patches
Message-ID <00000141dfc0e9ba-87feafac-b02e-4dd7-8ef9-9566dec9bd3a-000000@email.amazonses.com>
   Branch: refs/heads/master
     Home: https://github.com/mono/monodevelop
  Compare: https://github.com/mono/monodevelop/compare/a618106ee7dc...37631de0d9d6

   Commit: 37631de0d9d6df72bdd34fa17768d466c603a8b9
   Author: Therzok <[email protected]> (Therzok)
     Date: 2013-10-22 10:39:51 GMT
      URL: https://github.com/mono/monodevelop/commit/37631de0d9d6df72bdd34fa17768d466c603a8b9

[TestRunner] Cleanup in Runner.cs

Changed paths:
  M main/tests/TestRunner/Runner.cs

Modified: main/tests/TestRunner/Runner.cs
===================================================================
@@ -41,20 +41,21 @@ public int Run (string[] arguments)
 			var args = new List<string> (arguments);
 			bool useGuiUnit = false;
 			foreach (var ar in args) {
-				if ((ar.EndsWith (".dll") || ar.EndsWith (".exe")) && File.Exists (ar)) {
+				if ((ar.EndsWith (".dll", StringComparison.Ordinal) || ar.EndsWith (".exe", StringComparison.Ordinal)) && File.Exists (ar)) {
 					try {
-						var asm = Assembly.LoadFrom (Path.GetFullPath (ar));
-						HashSet<string> ids = new HashSet<string> ();
+						var path = Path.GetFullPath (ar);
+						var asm = Assembly.LoadFrom (path);
+						var ids = new HashSet<string> ();
 						foreach (var aname in asm.GetReferencedAssemblies ()) {
 							if (aname.Name == "GuiUnit") {
-								Assembly.LoadFile (Path.Combine (Path.GetDirectoryName (Path.GetFullPath (ar)), "GuiUnit.exe"));
+								Assembly.LoadFile (Path.Combine (Path.GetDirectoryName (path), "GuiUnit.exe"));
 								useGuiUnit = true;
 							}
 							ids.UnionWith (GetAddinsFromReferences (aname));
 						}
 
 						foreach (var id in ids)
-							AddinManager.LoadAddin (new Mono.Addins.ConsoleProgressStatus (false), id);
+							AddinManager.LoadAddin (new ConsoleProgressStatus (false), id);
 
 					} catch (Exception ex) {
 						Console.WriteLine (ex);
@@ -64,15 +65,14 @@ public int Run (string[] arguments)
 			if (useGuiUnit) {
 				var runnerType = Type.GetType ("GuiUnit.TestRunner, GuiUnit");
 				var method = runnerType.GetMethod ("Main", BindingFlags.Public | BindingFlags.Static);
-				return (int) method.Invoke (null, new [] { args.ToArray () });
-			} else {
-				args.RemoveAll (a => a.StartsWith ("-port="));
-				args.Add ("-domain=None");
-				return NUnit.ConsoleRunner.Runner.Main (args.ToArray ());
+				return (int)method.Invoke (null, new [] { args.ToArray () });
 			}
+			args.RemoveAll (a => a.StartsWith ("-port=", StringComparison.Ordinal));
+			args.Add ("-domain=None");
+			return NUnit.ConsoleRunner.Runner.Main (args.ToArray ());
 		}
 
-		IEnumerable<string> GetAddinsFromReferences (AssemblyName aname)
+		static IEnumerable<string> GetAddinsFromReferences (AssemblyName aname)
 		{
 			foreach (var adn in AddinManager.Registry.GetAddins ().Union (AddinManager.Registry.GetAddinRoots ())) {
 				foreach (ModuleDescription m in adn.Description.AllModules) {


_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.