harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r547563 - /harmony/enhanced/buildtest/branches/2.0/tests/tools/harness/org/apache/harmony/harness/Selector.java
Date Fri, 15 Jun 2007 07:24:10 GMT
Author: smishura
Date: Fri Jun 15 00:24:09 2007
New Revision: 547563

URL: http://svn.apache.org/viewvc?view=rev&rev=547563
Log:
Apply patch from HARMONY-4183:
([build-test][th] harness for stress/func suite should ignore '.svn' dirs)

Modified:
    harmony/enhanced/buildtest/branches/2.0/tests/tools/harness/org/apache/harmony/harness/Selector.java

Modified: harmony/enhanced/buildtest/branches/2.0/tests/tools/harness/org/apache/harmony/harness/Selector.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/tests/tools/harness/org/apache/harmony/harness/Selector.java?view=diff&rev=547563&r1=547562&r2=547563
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/tests/tools/harness/org/apache/harmony/harness/Selector.java
(original)
+++ harmony/enhanced/buildtest/branches/2.0/tests/tools/harness/org/apache/harmony/harness/Selector.java
Fri Jun 15 00:24:09 2007
@@ -84,6 +84,11 @@
     /* the constant to multiply the day field for time selection */
     public static final int     DAY_MULTIPLIER       = 1;
 
+    protected boolean           excludePredefinedNames = true;
+    protected String[]          predefinedNames        = { "/~", "/#", "/.#",
+        "/%", "/._", "/CVS/", "/.cvsignore/", "/SCCS/", "/vssver.scc/",
+        "/.svn/", "/.DS_Store/"                       };
+
     /* the list of tests that should be executed in the current run */
     protected Main              curCore              = Main.getCurCore();
 
@@ -188,12 +193,51 @@
      * default constructor: parse the config and create the arrays for selection
      */
     public Selector() {
+        setDefaultExclude();
         createSortArr();
         createDateNumber();
         createExcStat();
     }
 
     /*
+     * setup default exclude option: true/ false and list of substring Section
+     * in the configuration file for 'selector' plugin can looks like <parameter
+     * name="excludeDefault"> <value name="use">true </value> <value
+     * name="substring">/.svn </value> <value name="substring">/CVS </value>
+     * </parameter>
+     */
+    void setDefaultExclude() {
+        HashMap params;
+        HashMap tmpH;
+        ArrayList tmpA;
+
+        tmpA = (ArrayList)cfg.getPlugins().get("Selector");
+        if (tmpA == null) {
+            return;
+        }
+        tmpH = (HashMap)(tmpA).get(1);
+        if (tmpH == null) {
+            return;
+        }
+        params = (HashMap)tmpH.get("excludeDefault");
+        if (params != null) {
+            tmpA = (ArrayList)params.get("use");
+            if (tmpA != null && tmpA.size() > 0) {
+                if ("false".equalsIgnoreCase(tmpA.get(0).toString())) {
+                    excludePredefinedNames = false;
+                }
+            }
+            tmpA = (ArrayList)params.get("substring");
+            if (tmpA != null && tmpA.size() > 0) {
+                predefinedNames = new String[tmpA.size()];
+                for (int i = 0; i < tmpA.size(); i++) {
+                    predefinedNames[i] = tmpA.get(i).toString();
+                }
+            }
+        }
+    }
+
+    /*
      * create general sort array: to include and exclude tests String[0] =
      * SelKeywords(); String[1] = SelAuthor(); String[2] = SelModifAuthors();
      * String[3] = SelResources(); String[4] = SelRunners();
@@ -1056,6 +1100,15 @@
             + "\trunSelect(): ";
 
         boolean testAccepted = true;
+
+        //if test name has 'predefined exclude' part - exclude it
+        if (excludePredefinedNames) {
+            for (int i = 0; i < predefinedNames.length; i++) {
+                if (test.getTestID().contains(predefinedNames[i])) {
+                    return false;
+                }
+            }
+        }
 
         //if exclude list is defined and this test is excluded in this list:
         // skip it for run



Mime
View raw message