Add --exclude-test option to mono/mini test driver
authorAndi McClure <andi.mcclure@xamarin.com>
Wed, 3 Feb 2016 22:16:59 +0000 (17:16 -0500)
committerAndi McClure <andi.mcclure@xamarin.com>
Wed, 3 Feb 2016 22:16:59 +0000 (17:16 -0500)
mono/mini/TestDriver.cs

index c3bf999d2729ae30c014fee5a8e32a4f4449ce2f..fdd7a10466f2b5f4cbd410f1723cfe5fba5b0dc0 100644 (file)
@@ -32,6 +32,7 @@ public class TestDriver {
 
                var exclude = new Dictionary<string, string> ();
                List<string> run_only = new List<string> ();
+               List<string> exclude_test = new List<string> ();
                if (args != null && args.Length > 0) {
                        for (j = 0; j < args.Length;) {
                                if (args [j] == "--time") {
@@ -51,6 +52,9 @@ public class TestDriver {
                                } else if (args [j] == "--exclude") {
                                        exclude [args [j + 1]] = args [j + 1];
                                        j += 2;
+                               } else if (args [j] == "--exclude-test") {
+                                       exclude_test.Add (args [j + 1]);
+                                       j += 2;
                                } else if (args [j] == "--run-only") {
                                        run_only.Add (args [j + 1]);
                                        j += 2;
@@ -78,9 +82,15 @@ public class TestDriver {
                                        if (!found)
                                                continue;
                                }
-                               if (exclude.Count > 0) {
+                               if (exclude.Count > 0 || exclude_test.Count > 0) {
                                        var attrs = methods [i].GetCustomAttributes (typeof (CategoryAttribute), false);
                                        bool skip = false;
+                                       for (j = 0; j < exclude_test.Count; j++) {
+                                               if (name.EndsWith (exclude_test [j])) {
+                                                       skip = true;
+                                                       break;
+                                               }
+                                       }
                                        foreach (CategoryAttribute attr in attrs) {
                                                if (exclude.ContainsKey (attr.Category))
                                                        skip = true;