Bug 1258916 part 4 - Simplify code for skipping dir when populating test files. r=dbaron
authorXidorn Quan <quanxunzhen@gmail.com>
Wed, 23 Mar 2016 18:51:09 +0800
changeset 331108 62f3627f60235bafaa7d9425a058c8af5ecd2a39
parent 331107 98af3ab721a2f3837ad891b672803a5c60dfcf4b
child 331109 6a5e55d72b41596d83ab1bb1f9f15c6cce1fac9a
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs1258916
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1258916 part 4 - Simplify code for skipping dir when populating test files. r=dbaron MozReview-Commit-ID: CXDyfTAn5qv
layout/reftests/w3c-css/import-tests.py
--- a/layout/reftests/w3c-css/import-tests.py
+++ b/layout/reftests/w3c-css/import-tests.py
@@ -101,26 +101,22 @@ def remove_existing_dirs():
     for dirname in os.listdir(gDestPath):
         fulldir = os.path.join(gDestPath, dirname)
         if not os.path.isdir(fulldir):
             continue
         shutil.rmtree(fulldir)
 
 def populate_test_files():
     global gSubtrees, gTestfiles
+    excludeDirs = ["support", "reftest", "reference", "reports", "tools"]
     for subtree in gSubtrees:
         for dirpath, dirnames, filenames in os.walk(subtree, topdown=True):
-            if "support" in dirnames:
-               dirnames.remove("support")
-            if "reftest" in dirnames:
-               dirnames.remove("reftest")
-            if "reference" in dirnames:
-               dirnames.remove("reference")
-            if "reports" in dirnames:
-               dirnames.remove("reports")
+            for exclDir in excludeDirs:
+                if exclDir in dirnames:
+                    dirnames.remove(exclDir)
             for f in filenames:
                 if f == "README" or \
                    f.find("-ref.") != -1:
                     continue
                 gTestfiles.append(os.path.join(dirpath, f))
 
     gTestfiles.sort()