Phil Dubach | ec19a57 | 2009-08-21 15:20:13 -0700 | [diff] [blame] | 1 | #!/usr/bin/python |
Phil Dubach | 0d6ef06 | 2009-08-12 18:13:16 -0700 | [diff] [blame] | 2 | |
| 3 | # Copyright (C) 2009 The Android Open Source Project |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | |
| 17 | """Module for generating CTS test descriptions and test plans.""" |
| 18 | |
| 19 | import glob |
| 20 | import os |
| 21 | import re |
Unsuk Jung | 2a692d1 | 2013-09-29 20:57:32 -0700 | [diff] [blame] | 22 | import shutil |
Phil Dubach | 0d6ef06 | 2009-08-12 18:13:16 -0700 | [diff] [blame] | 23 | import subprocess |
| 24 | import sys |
| 25 | import xml.dom.minidom as dom |
| 26 | from cts import tools |
Brian Muramatsu | 9157e0a | 2011-04-05 18:06:15 -0700 | [diff] [blame] | 27 | from multiprocessing import Pool |
Phil Dubach | 0d6ef06 | 2009-08-12 18:13:16 -0700 | [diff] [blame] | 28 | |
| 29 | def GetSubDirectories(root): |
| 30 | """Return all directories under the given root directory.""" |
| 31 | return [x for x in os.listdir(root) if os.path.isdir(os.path.join(root, x))] |
| 32 | |
| 33 | |
| 34 | def GetMakeFileVars(makefile_path): |
| 35 | """Extracts variable definitions from the given make file. |
| 36 | |
| 37 | Args: |
| 38 | makefile_path: Path to the make file. |
| 39 | |
| 40 | Returns: |
| 41 | A dictionary mapping variable names to their assigned value. |
| 42 | """ |
| 43 | result = {} |
| 44 | pattern = re.compile(r'^\s*([^:#=\s]+)\s*:=\s*(.*?[^\\])$', re.MULTILINE + re.DOTALL) |
| 45 | stream = open(makefile_path, 'r') |
| 46 | content = stream.read() |
| 47 | for match in pattern.finditer(content): |
| 48 | result[match.group(1)] = match.group(2) |
| 49 | stream.close() |
| 50 | return result |
| 51 | |
| 52 | |
| 53 | class CtsBuilder(object): |
| 54 | """Main class for generating test descriptions and test plans.""" |
| 55 | |
| 56 | def __init__(self, argv): |
| 57 | """Initialize the CtsBuilder from command line arguments.""" |
Keun young Park | d93d0d1 | 2013-01-10 14:11:35 -0800 | [diff] [blame] | 58 | if len(argv) != 6: |
| 59 | print 'Usage: %s <testRoot> <ctsOutputDir> <tempDir> <androidRootDir> <docletPath>' % argv[0] |
Phil Dubach | 0d6ef06 | 2009-08-12 18:13:16 -0700 | [diff] [blame] | 60 | print '' |
| 61 | print 'testRoot: Directory under which to search for CTS tests.' |
| 62 | print 'ctsOutputDir: Directory in which the CTS repository should be created.' |
| 63 | print 'tempDir: Directory to use for storing temporary files.' |
| 64 | print 'androidRootDir: Root directory of the Android source tree.' |
| 65 | print 'docletPath: Class path where the DescriptionGenerator doclet can be found.' |
| 66 | sys.exit(1) |
| 67 | self.test_root = sys.argv[1] |
| 68 | self.out_dir = sys.argv[2] |
| 69 | self.temp_dir = sys.argv[3] |
| 70 | self.android_root = sys.argv[4] |
| 71 | self.doclet_path = sys.argv[5] |
| 72 | |
| 73 | self.test_repository = os.path.join(self.out_dir, 'repository/testcases') |
| 74 | self.plan_repository = os.path.join(self.out_dir, 'repository/plans') |
Unsuk Jung | 08d97f9 | 2013-09-29 22:40:22 -0700 | [diff] [blame] | 75 | self.definedplans_repository = os.path.join(self.android_root, 'cts/tests/plans') |
Phil Dubach | 0d6ef06 | 2009-08-12 18:13:16 -0700 | [diff] [blame] | 76 | |
Phil Dubach | 0d6ef06 | 2009-08-12 18:13:16 -0700 | [diff] [blame] | 77 | def GenerateTestDescriptions(self): |
| 78 | """Generate test descriptions for all packages.""" |
Brian Muramatsu | 5df641c | 2011-12-28 15:46:57 -0800 | [diff] [blame] | 79 | pool = Pool(processes=2) |
Brian Muramatsu | 9157e0a | 2011-04-05 18:06:15 -0700 | [diff] [blame] | 80 | |
Phil Dubach | 0d6ef06 | 2009-08-12 18:13:16 -0700 | [diff] [blame] | 81 | # generate test descriptions for android tests |
Brian Muramatsu | bdcfc7c | 2011-12-01 14:32:02 -0800 | [diff] [blame] | 82 | results = [] |
Brian Muramatsu | 9157e0a | 2011-04-05 18:06:15 -0700 | [diff] [blame] | 83 | pool.close() |
| 84 | pool.join() |
Brian Muramatsu | bdcfc7c | 2011-12-01 14:32:02 -0800 | [diff] [blame] | 85 | return sum(map(lambda result: result.get(), results)) |
Phil Dubach | 0d6ef06 | 2009-08-12 18:13:16 -0700 | [diff] [blame] | 86 | |
| 87 | def __WritePlan(self, plan, plan_name): |
| 88 | print 'Generating test plan %s' % plan_name |
| 89 | plan.Write(os.path.join(self.plan_repository, plan_name + '.xml')) |
| 90 | |
| 91 | def GenerateTestPlans(self): |
| 92 | """Generate default test plans.""" |
| 93 | # TODO: Instead of hard-coding the plans here, use a configuration file, |
| 94 | # such as test_defs.xml |
| 95 | packages = [] |
Phil Dubach | 8dcedfe | 2009-08-20 16:10:39 -0700 | [diff] [blame] | 96 | descriptions = sorted(glob.glob(os.path.join(self.test_repository, '*.xml'))) |
Phil Dubach | 0d6ef06 | 2009-08-12 18:13:16 -0700 | [diff] [blame] | 97 | for description in descriptions: |
| 98 | doc = tools.XmlFile(description) |
| 99 | packages.append(doc.GetAttr('TestPackage', 'appPackageName')) |
Keun young Park | 965d191 | 2013-02-08 11:37:16 -0800 | [diff] [blame] | 100 | # sort the list to give the same sequence based on name |
| 101 | packages.sort() |
Phil Dubach | 0d6ef06 | 2009-08-12 18:13:16 -0700 | [diff] [blame] | 102 | |
| 103 | plan = tools.TestPlan(packages) |
Tsu Chiang Chuang | d4cce3b | 2011-05-12 12:19:54 -0700 | [diff] [blame] | 104 | plan.Exclude('android\.performance.*') |
Brian Muramatsu | 87ff4df | 2011-12-16 11:41:17 -0800 | [diff] [blame] | 105 | self.__WritePlan(plan, 'CTS') |
Brian Muramatsu | 89ae08c | 2012-01-03 10:55:02 -0800 | [diff] [blame] | 106 | self.__WritePlan(plan, 'CTS-TF') |
Tsu Chiang Chuang | d4cce3b | 2011-05-12 12:19:54 -0700 | [diff] [blame] | 107 | |
Keun young Park | d93d0d1 | 2013-01-10 14:11:35 -0800 | [diff] [blame] | 108 | plan = tools.TestPlan(packages) |
Keun young Park | d93d0d1 | 2013-01-10 14:11:35 -0800 | [diff] [blame] | 109 | plan.Exclude('android\.performance.*') |
Guru Nagarajan | 55f10db | 2013-06-03 13:50:37 -0700 | [diff] [blame] | 110 | plan.Exclude('android\.media\.cts\.StreamingMediaPlayerTest.*') |
| 111 | # Test plan to not include media streaming tests |
| 112 | self.__WritePlan(plan, 'CTS-No-Media-Stream') |
| 113 | |
| 114 | plan = tools.TestPlan(packages) |
| 115 | plan.Exclude('android\.performance.*') |
Keun young Park | d93d0d1 | 2013-01-10 14:11:35 -0800 | [diff] [blame] | 116 | self.__WritePlan(plan, 'SDK') |
| 117 | |
Stuart Scott | f67280f | 2014-09-30 14:07:30 -0700 | [diff] [blame] | 118 | plan.Exclude(r'android\.signature') |
Phil Dubach | 0d6ef06 | 2009-08-12 18:13:16 -0700 | [diff] [blame] | 119 | plan.Exclude(r'android\.core.*') |
| 120 | self.__WritePlan(plan, 'Android') |
| 121 | |
| 122 | plan = tools.TestPlan(packages) |
| 123 | plan.Include(r'android\.core\.tests.*') |
Tsu Chiang Chuang | cf7ceab | 2012-10-24 16:48:03 -0700 | [diff] [blame] | 124 | plan.Exclude(r'android\.core\.tests\.libcore.\package.\harmony*') |
Phil Dubach | 0d6ef06 | 2009-08-12 18:13:16 -0700 | [diff] [blame] | 125 | self.__WritePlan(plan, 'Java') |
| 126 | |
Tsu Chiang Chuang | cf7ceab | 2012-10-24 16:48:03 -0700 | [diff] [blame] | 127 | # TODO: remove this once the tests are fixed and merged into Java plan above. |
| 128 | plan = tools.TestPlan(packages) |
| 129 | plan.Include(r'android\.core\.tests\.libcore.\package.\harmony*') |
| 130 | self.__WritePlan(plan, 'Harmony') |
| 131 | |
Phil Dubach | 0d6ef06 | 2009-08-12 18:13:16 -0700 | [diff] [blame] | 132 | plan = tools.TestPlan(packages) |
Tsu Chiang Chuang | 9a223d7 | 2011-04-27 17:19:46 -0700 | [diff] [blame] | 133 | plan.Include(r'android\.core\.vm-tests-tf') |
| 134 | self.__WritePlan(plan, 'VM-TF') |
| 135 | |
| 136 | plan = tools.TestPlan(packages) |
Phil Dubach | 6068048 | 2009-08-19 10:13:23 -0700 | [diff] [blame] | 137 | plan.Include(r'android\.tests\.appsecurity') |
| 138 | self.__WritePlan(plan, 'AppSecurity') |
| 139 | |
Keun young Park | ff19417 | 2012-08-14 17:56:11 -0700 | [diff] [blame] | 140 | # hard-coded white list for PDK plan |
| 141 | plan.Exclude('.*') |
keunyoung | c767cba | 2013-04-03 14:50:58 -0700 | [diff] [blame] | 142 | plan.Include('android\.aadb') |
Keun young Park | ff19417 | 2012-08-14 17:56:11 -0700 | [diff] [blame] | 143 | plan.Include('android\.bluetooth') |
| 144 | plan.Include('android\.graphics.*') |
| 145 | plan.Include('android\.hardware') |
keunyoung | de51946 | 2013-03-21 12:06:42 -0700 | [diff] [blame] | 146 | plan.Include('android\.media') |
| 147 | plan.Exclude('android\.mediastress') |
Keun young Park | ff19417 | 2012-08-14 17:56:11 -0700 | [diff] [blame] | 148 | plan.Include('android\.net') |
| 149 | plan.Include('android\.opengl.*') |
| 150 | plan.Include('android\.renderscript') |
| 151 | plan.Include('android\.telephony') |
| 152 | plan.Include('android\.nativemedia.*') |
Stuart Scott | a132af6 | 2013-11-07 10:30:32 -0800 | [diff] [blame] | 153 | plan.Include('com\.android\.cts\..*')#TODO(stuartscott): Should PDK have all these? |
Keun young Park | ff19417 | 2012-08-14 17:56:11 -0700 | [diff] [blame] | 154 | self.__WritePlan(plan, 'PDK') |
| 155 | |
Nicholas Sauer | 471c601 | 2014-05-28 15:28:28 -0700 | [diff] [blame] | 156 | flaky_tests = BuildCtsFlakyTestList() |
| 157 | |
| 158 | # CTS Stable plan |
| 159 | plan = tools.TestPlan(packages) |
Unsuk Jung | 7c7832b | 2014-09-06 20:31:08 -0700 | [diff] [blame] | 160 | plan.Exclude(r'com\.android\.cts\.browserbench') |
Unsuk Jung | 2e4e929 | 2014-10-09 02:20:44 -0700 | [diff] [blame^] | 161 | plan.Exclude(r'com\.android\.cts\.filesystemperf\.RandomRWTest$') |
Nicholas Sauer | 471c601 | 2014-05-28 15:28:28 -0700 | [diff] [blame] | 162 | for package, test_list in flaky_tests.iteritems(): |
| 163 | plan.ExcludeTests(package, test_list) |
| 164 | self.__WritePlan(plan, 'CTS-stable') |
| 165 | |
Unsuk Jung | 8398ab8 | 2014-09-19 03:26:39 -0700 | [diff] [blame] | 166 | # CTS Flaky plan - list of tests known to be flaky in lab environment |
Nicholas Sauer | 471c601 | 2014-05-28 15:28:28 -0700 | [diff] [blame] | 167 | plan = tools.TestPlan(packages) |
| 168 | plan.Exclude('.*') |
Unsuk Jung | 7c7832b | 2014-09-06 20:31:08 -0700 | [diff] [blame] | 169 | plan.Include(r'com\.android\.cts\.browserbench') |
Unsuk Jung | 2e4e929 | 2014-10-09 02:20:44 -0700 | [diff] [blame^] | 170 | plan.Include(r'com\.android\.cts\.filesystemperf\.RandomRWTest$') |
Nicholas Sauer | 471c601 | 2014-05-28 15:28:28 -0700 | [diff] [blame] | 171 | for package, test_list in flaky_tests.iteritems(): |
Unsuk Jung | b5153c4 | 2014-09-19 02:12:50 -0700 | [diff] [blame] | 172 | plan.Include(package+'$') |
Nicholas Sauer | 471c601 | 2014-05-28 15:28:28 -0700 | [diff] [blame] | 173 | plan.IncludeTests(package, test_list) |
| 174 | self.__WritePlan(plan, 'CTS-flaky') |
| 175 | |
Unsuk Jung | 8398ab8 | 2014-09-19 03:26:39 -0700 | [diff] [blame] | 176 | small_tests = BuildAospSmallSizeTestList() |
| 177 | medium_tests = BuildAospMediumSizeTestList() |
Unsuk Jung | 5867612 | 2014-09-28 10:31:00 -0700 | [diff] [blame] | 178 | new_test_packages = BuildCtsVettedNewPackagesList() |
Unsuk Jung | 8398ab8 | 2014-09-19 03:26:39 -0700 | [diff] [blame] | 179 | |
| 180 | # CTS - sub plan for public, small size tests |
| 181 | plan = tools.TestPlan(packages) |
| 182 | plan.Exclude('.*') |
| 183 | for package, test_list in small_tests.iteritems(): |
| 184 | plan.Include(package+'$') |
Unsuk Jung | 2e4e929 | 2014-10-09 02:20:44 -0700 | [diff] [blame^] | 185 | plan.Exclude(r'com\.android\.cts\.browserbench') |
| 186 | plan.Exclude(r'com\.android\.cts\.filesystemperf\.RandomRWTest$') |
Unsuk Jung | 8398ab8 | 2014-09-19 03:26:39 -0700 | [diff] [blame] | 187 | for package, test_list in flaky_tests.iteritems(): |
| 188 | plan.ExcludeTests(package, test_list) |
| 189 | self.__WritePlan(plan, 'CTS-kitkat-small') |
| 190 | |
| 191 | # CTS - sub plan for public, medium size tests |
| 192 | plan = tools.TestPlan(packages) |
| 193 | plan.Exclude('.*') |
| 194 | for package, test_list in medium_tests.iteritems(): |
| 195 | plan.Include(package+'$') |
Unsuk Jung | 2e4e929 | 2014-10-09 02:20:44 -0700 | [diff] [blame^] | 196 | plan.Exclude(r'com\.android\.cts\.browserbench') |
| 197 | plan.Exclude(r'com\.android\.cts\.filesystemperf\.RandomRWTest$') |
Unsuk Jung | 8398ab8 | 2014-09-19 03:26:39 -0700 | [diff] [blame] | 198 | for package, test_list in flaky_tests.iteritems(): |
| 199 | plan.ExcludeTests(package, test_list) |
| 200 | self.__WritePlan(plan, 'CTS-kitkat-medium') |
| 201 | |
| 202 | # CTS - sub plan for hardware tests which is public, large |
| 203 | plan = tools.TestPlan(packages) |
| 204 | plan.Exclude('.*') |
| 205 | plan.Include(r'android\.hardware$') |
Unsuk Jung | 2e4e929 | 2014-10-09 02:20:44 -0700 | [diff] [blame^] | 206 | plan.Exclude(r'com\.android\.cts\.browserbench') |
| 207 | plan.Exclude(r'com\.android\.cts\.filesystemperf\.RandomRWTest$') |
Unsuk Jung | 8398ab8 | 2014-09-19 03:26:39 -0700 | [diff] [blame] | 208 | for package, test_list in flaky_tests.iteritems(): |
| 209 | plan.ExcludeTests(package, test_list) |
| 210 | self.__WritePlan(plan, 'CTS-hardware') |
| 211 | |
| 212 | # CTS - sub plan for media tests which is public, large |
| 213 | plan = tools.TestPlan(packages) |
| 214 | plan.Exclude('.*') |
| 215 | plan.Include(r'android\.media$') |
Unsuk Jung | 2e4e929 | 2014-10-09 02:20:44 -0700 | [diff] [blame^] | 216 | plan.Exclude(r'com\.android\.cts\.browserbench') |
| 217 | plan.Exclude(r'com\.android\.cts\.filesystemperf\.RandomRWTest$') |
Unsuk Jung | 8398ab8 | 2014-09-19 03:26:39 -0700 | [diff] [blame] | 218 | for package, test_list in flaky_tests.iteritems(): |
| 219 | plan.ExcludeTests(package, test_list) |
| 220 | self.__WritePlan(plan, 'CTS-media') |
| 221 | |
| 222 | # CTS - sub plan for mediastress tests which is public, large |
| 223 | plan = tools.TestPlan(packages) |
| 224 | plan.Exclude('.*') |
| 225 | plan.Include(r'android\.mediastress$') |
Unsuk Jung | 2e4e929 | 2014-10-09 02:20:44 -0700 | [diff] [blame^] | 226 | plan.Exclude(r'com\.android\.cts\.browserbench') |
| 227 | plan.Exclude(r'com\.android\.cts\.filesystemperf\.RandomRWTest$') |
Unsuk Jung | 8398ab8 | 2014-09-19 03:26:39 -0700 | [diff] [blame] | 228 | for package, test_list in flaky_tests.iteritems(): |
| 229 | plan.ExcludeTests(package, test_list) |
| 230 | self.__WritePlan(plan, 'CTS-mediastress') |
| 231 | |
Unsuk Jung | 5867612 | 2014-09-28 10:31:00 -0700 | [diff] [blame] | 232 | # CTS - sub plan for new tests that is vetted for L launch |
| 233 | plan = tools.TestPlan(packages) |
| 234 | plan.Exclude('.*') |
| 235 | for package, test_list in new_test_packages.iteritems(): |
| 236 | plan.Include(package+'$') |
Unsuk Jung | 2e4e929 | 2014-10-09 02:20:44 -0700 | [diff] [blame^] | 237 | plan.Exclude(r'com\.android\.cts\.browserbench') |
| 238 | plan.Exclude(r'com\.android\.cts\.filesystemperf\.RandomRWTest$') |
Unsuk Jung | 5867612 | 2014-09-28 10:31:00 -0700 | [diff] [blame] | 239 | for package, test_list in flaky_tests.iteritems(): |
| 240 | plan.ExcludeTests(package, test_list) |
| 241 | self.__WritePlan(plan, 'CTS-l-tests') |
| 242 | |
Unsuk Jung | 8398ab8 | 2014-09-19 03:26:39 -0700 | [diff] [blame] | 243 | #CTS - sub plan for new test packages added for staging |
| 244 | plan = tools.TestPlan(packages) |
| 245 | for package, test_list in small_tests.iteritems(): |
| 246 | plan.Exclude(package+'$') |
| 247 | for package, test_list in medium_tests.iteritems(): |
| 248 | plan.Exclude(package+'$') |
Unsuk Jung | 5867612 | 2014-09-28 10:31:00 -0700 | [diff] [blame] | 249 | for package, tests_list in new_test_packages.iteritems(): |
| 250 | plan.Exclude(package+'$') |
Unsuk Jung | 8398ab8 | 2014-09-19 03:26:39 -0700 | [diff] [blame] | 251 | plan.Exclude(r'android\.hardware$') |
| 252 | plan.Exclude(r'android\.media$') |
| 253 | plan.Exclude(r'android\.mediastress$') |
Unsuk Jung | 2e4e929 | 2014-10-09 02:20:44 -0700 | [diff] [blame^] | 254 | plan.Exclude(r'com\.android\.cts\.browserbench') |
| 255 | plan.Exclude(r'com\.android\.cts\.filesystemperf\.RandomRWTest$') |
Unsuk Jung | 8398ab8 | 2014-09-19 03:26:39 -0700 | [diff] [blame] | 256 | for package, test_list in flaky_tests.iteritems(): |
| 257 | plan.ExcludeTests(package, test_list) |
| 258 | self.__WritePlan(plan, 'CTS-staging') |
| 259 | |
Unsuk Jung | 20a389e | 2014-09-26 15:21:59 -0700 | [diff] [blame] | 260 | plan = tools.TestPlan(packages) |
| 261 | plan.Exclude('.*') |
| 262 | plan.Include(r'android\.core\.tests\.libcore\.') |
| 263 | plan.Include(r'android\.jdwp') |
| 264 | self.__WritePlan(plan, 'CTS-ART') |
| 265 | |
| 266 | plan = tools.TestPlan(packages) |
| 267 | plan.Exclude('.*') |
| 268 | plan.Include(r'com\.drawelements\.') |
| 269 | self.__WritePlan(plan, 'CTS-DEQP') |
| 270 | |
| 271 | plan = tools.TestPlan(packages) |
| 272 | plan.Exclude('.*') |
| 273 | plan.Include(r'android\.webgl') |
| 274 | self.__WritePlan(plan, 'CTS-webview') |
| 275 | |
| 276 | |
Unsuk Jung | 8398ab8 | 2014-09-19 03:26:39 -0700 | [diff] [blame] | 277 | def BuildAospMediumSizeTestList(): |
| 278 | """ Construct a defaultdic that lists package names of medium tests |
| 279 | already published to aosp. """ |
| 280 | return { |
| 281 | 'android.app' : [], |
| 282 | 'android.core.tests.libcore.package.libcore' : [], |
| 283 | 'android.core.tests.libcore.package.org' : [], |
| 284 | 'android.core.vm-tests-tf' : [], |
| 285 | 'android.dpi' : [], |
| 286 | 'android.host.security' : [], |
| 287 | 'android.net' : [], |
| 288 | 'android.os' : [], |
Unsuk Jung | 2e4e929 | 2014-10-09 02:20:44 -0700 | [diff] [blame^] | 289 | 'android.permission2' : [], |
Unsuk Jung | 8398ab8 | 2014-09-19 03:26:39 -0700 | [diff] [blame] | 290 | 'android.security' : [], |
| 291 | 'android.telephony' : [], |
| 292 | 'android.webkit' : [], |
| 293 | 'android.widget' : [], |
| 294 | 'com.android.cts.browserbench' : []} |
| 295 | |
| 296 | def BuildAospSmallSizeTestList(): |
| 297 | """ Construct a defaultdict that lists packages names of small tests |
| 298 | already published to aosp. """ |
| 299 | return { |
| 300 | 'android.aadb' : [], |
| 301 | 'android.acceleration' : [], |
| 302 | 'android.accessibility' : [], |
| 303 | 'android.accessibilityservice' : [], |
| 304 | 'android.accounts' : [], |
| 305 | 'android.admin' : [], |
| 306 | 'android.animation' : [], |
| 307 | 'android.bionic' : [], |
| 308 | 'android.bluetooth' : [], |
| 309 | 'android.calendarcommon' : [], |
| 310 | 'android.content' : [], |
| 311 | 'android.core.tests.libcore.package.com' : [], |
| 312 | 'android.core.tests.libcore.package.conscrypt' : [], |
| 313 | 'android.core.tests.libcore.package.dalvik' : [], |
| 314 | 'android.core.tests.libcore.package.sun' : [], |
| 315 | 'android.core.tests.libcore.package.tests' : [], |
| 316 | 'android.database' : [], |
| 317 | 'android.dreams' : [], |
| 318 | 'android.drm' : [], |
| 319 | 'android.effect' : [], |
| 320 | 'android.gesture' : [], |
| 321 | 'android.graphics' : [], |
| 322 | 'android.graphics2' : [], |
| 323 | 'android.jni' : [], |
| 324 | 'android.keystore' : [], |
| 325 | 'android.location' : [], |
| 326 | 'android.nativemedia.sl' : [], |
| 327 | 'android.nativemedia.xa' : [], |
| 328 | 'android.nativeopengl' : [], |
| 329 | 'android.ndef' : [], |
| 330 | 'android.opengl' : [], |
| 331 | 'android.openglperf' : [], |
| 332 | 'android.permission' : [], |
Unsuk Jung | 8398ab8 | 2014-09-19 03:26:39 -0700 | [diff] [blame] | 333 | 'android.preference' : [], |
| 334 | 'android.preference2' : [], |
| 335 | 'android.provider' : [], |
| 336 | 'android.renderscript' : [], |
| 337 | 'android.rscpp' : [], |
| 338 | 'android.rsg' : [], |
| 339 | 'android.sax' : [], |
Stuart Scott | f67280f | 2014-09-30 14:07:30 -0700 | [diff] [blame] | 340 | 'android.signature' : [], |
Unsuk Jung | 8398ab8 | 2014-09-19 03:26:39 -0700 | [diff] [blame] | 341 | 'android.speech' : [], |
| 342 | 'android.tests.appsecurity' : [], |
| 343 | 'android.text' : [], |
| 344 | 'android.textureview' : [], |
| 345 | 'android.theme' : [], |
| 346 | 'android.usb' : [], |
| 347 | 'android.util' : [], |
| 348 | 'android.view' : [], |
| 349 | 'com.android.cts.dram' : [], |
| 350 | 'com.android.cts.filesystemperf' : [], |
| 351 | 'com.android.cts.jank' : [], |
| 352 | 'com.android.cts.opengl' : [], |
| 353 | 'com.android.cts.simplecpu' : [], |
| 354 | 'com.android.cts.ui' : [], |
| 355 | 'com.android.cts.uihost' : [], |
| 356 | 'com.android.cts.videoperf' : [], |
| 357 | 'zzz.android.monkey' : []} |
Nicholas Sauer | 471c601 | 2014-05-28 15:28:28 -0700 | [diff] [blame] | 358 | |
Unsuk Jung | 5867612 | 2014-09-28 10:31:00 -0700 | [diff] [blame] | 359 | def BuildCtsVettedNewPackagesList(): |
| 360 | """ Construct a defaultdict that maps package names that is vetted for L. """ |
| 361 | return { |
| 362 | 'android.appwidget' : [], |
| 363 | 'android.core.tests.libcore.package.harmony_annotation' : [], |
| 364 | 'android.core.tests.libcore.package.harmony_beans' : [], |
| 365 | 'android.core.tests.libcore.package.harmony_java_io' : [], |
| 366 | 'android.core.tests.libcore.package.harmony_java_lang' : [], |
| 367 | 'android.core.tests.libcore.package.harmony_java_math' : [], |
| 368 | 'android.core.tests.libcore.package.harmony_java_net' : [], |
| 369 | 'android.core.tests.libcore.package.harmony_java_nio' : [], |
| 370 | 'android.core.tests.libcore.package.harmony_java_util' : [], |
| 371 | 'android.core.tests.libcore.package.harmony_javax_security' : [], |
| 372 | 'android.core.tests.libcore.package.harmony_logging' : [], |
| 373 | 'android.core.tests.libcore.package.harmony_prefs' : [], |
| 374 | 'android.core.tests.libcore.package.harmony_sql' : [], |
| 375 | 'android.core.tests.libcore.package.jsr166' : [], |
| 376 | 'android.core.tests.libcore.package.okhttp' : [], |
| 377 | 'android.display' : [], |
| 378 | 'android.host.theme' : [], |
| 379 | 'android.jdwp' : [], |
| 380 | 'android.location2' : [], |
| 381 | 'android.print' : [], |
| 382 | 'android.renderscriptlegacy' : [], |
Stuart Scott | f67280f | 2014-09-30 14:07:30 -0700 | [diff] [blame] | 383 | 'android.signature' : [], |
Unsuk Jung | 5867612 | 2014-09-28 10:31:00 -0700 | [diff] [blame] | 384 | 'android.tv' : [], |
| 385 | 'android.uiautomation' : [], |
| 386 | 'android.uirendering' : [], |
| 387 | 'android.webgl' : []} |
| 388 | |
Nicholas Sauer | 471c601 | 2014-05-28 15:28:28 -0700 | [diff] [blame] | 389 | def BuildCtsFlakyTestList(): |
| 390 | """ Construct a defaultdict that maps package name to a list of tests |
| 391 | that are known to be flaky. """ |
| 392 | return { |
| 393 | 'android.app' : [ |
Unsuk Jung | 2e4e929 | 2014-10-09 02:20:44 -0700 | [diff] [blame^] | 394 | 'cts.ActivityManagerTest#testIsRunningInTestHarness',], |
Unsuk Jung | 1d72924 | 2014-09-08 09:23:03 -0700 | [diff] [blame] | 395 | 'android.dpi' : [ |
| 396 | 'cts.DefaultManifestAttributesSdkTest#testPackageHasExpectedSdkVersion',], |
Nicholas Sauer | 471c601 | 2014-05-28 15:28:28 -0700 | [diff] [blame] | 397 | 'android.hardware' : [ |
Nicholas Sauer | 471c601 | 2014-05-28 15:28:28 -0700 | [diff] [blame] | 398 | 'cts.CameraTest#testVideoSnapshot', |
| 399 | 'cts.CameraGLTest#testCameraToSurfaceTextureMetadata', |
| 400 | 'cts.CameraGLTest#testSetPreviewTextureBothCallbacks', |
| 401 | 'cts.CameraGLTest#testSetPreviewTexturePreviewCallback',], |
| 402 | 'android.media' : [ |
| 403 | 'cts.DecoderTest#testCodecResetsH264WithSurface', |
| 404 | 'cts.StreamingMediaPlayerTest#testHLS',], |
Nicholas Sauer | 471c601 | 2014-05-28 15:28:28 -0700 | [diff] [blame] | 405 | 'android.net' : [ |
| 406 | 'cts.ConnectivityManagerTest#testStartUsingNetworkFeature_enableHipri', |
| 407 | 'cts.DnsTest#testDnsWorks', |
| 408 | 'cts.SSLCertificateSocketFactoryTest#testCreateSocket', |
| 409 | 'cts.SSLCertificateSocketFactoryTest#test_createSocket_bind', |
| 410 | 'cts.SSLCertificateSocketFactoryTest#test_createSocket_simple', |
| 411 | 'cts.SSLCertificateSocketFactoryTest#test_createSocket_wrapping', |
| 412 | 'cts.TrafficStatsTest#testTrafficStatsForLocalhost', |
Unsuk Jung | 2e4e929 | 2014-10-09 02:20:44 -0700 | [diff] [blame^] | 413 | 'wifi.cts.NsdManagerTest#testAndroidTestCaseSetupProperly',], |
Unsuk Jung | 1d72924 | 2014-09-08 09:23:03 -0700 | [diff] [blame] | 414 | 'android.os' : [ |
| 415 | 'cts.BuildVersionTest#testReleaseVersion', |
| 416 | 'cts.BuildTest#testIsSecureUserBuild',], |
Nicholas Sauer | 471c601 | 2014-05-28 15:28:28 -0700 | [diff] [blame] | 417 | 'android.security' : [ |
| 418 | 'cts.BannedFilesTest#testNoSu', |
| 419 | 'cts.BannedFilesTest#testNoSuInPath', |
| 420 | 'cts.ListeningPortsTest#testNoRemotelyAccessibleListeningUdp6Ports', |
| 421 | 'cts.ListeningPortsTest#testNoRemotelyAccessibleListeningUdpPorts', |
Unsuk Jung | 7035960 | 2014-10-09 01:30:51 -0700 | [diff] [blame] | 422 | 'cts.PackageSignatureTest#testPackageSignatures', |
| 423 | 'cts.SELinuxDomainTest#testSuDomain', |
| 424 | 'cts.SELinuxHostTest#testAllEnforcing',], |
Nicholas Sauer | 471c601 | 2014-05-28 15:28:28 -0700 | [diff] [blame] | 425 | 'android.webkit' : [ |
Unsuk Jung | 2e4e929 | 2014-10-09 02:20:44 -0700 | [diff] [blame^] | 426 | 'cts.WebViewClientTest#testOnUnhandledKeyEvent',]} |
Unsuk Jung | 2a692d1 | 2013-09-29 20:57:32 -0700 | [diff] [blame] | 427 | |
Brian Muramatsu | 9157e0a | 2011-04-05 18:06:15 -0700 | [diff] [blame] | 428 | def LogGenerateDescription(name): |
| 429 | print 'Generating test description for package %s' % name |
| 430 | |
Phil Dubach | 0d6ef06 | 2009-08-12 18:13:16 -0700 | [diff] [blame] | 431 | if __name__ == '__main__': |
| 432 | builder = CtsBuilder(sys.argv) |
Keun young Park | d93d0d1 | 2013-01-10 14:11:35 -0800 | [diff] [blame] | 433 | result = builder.GenerateTestDescriptions() |
| 434 | if result != 0: |
| 435 | sys.exit(result) |
Phil Dubach | 0d6ef06 | 2009-08-12 18:13:16 -0700 | [diff] [blame] | 436 | builder.GenerateTestPlans() |
Keun young Park | 3769d33 | 2012-08-29 10:16:37 -0700 | [diff] [blame] | 437 | |