DO NOT MERGE add running time hints for dEQP packages

Change-Id: Iac61edd175714ffb5901925ac81c16e9a3a18d81
diff --git a/android/cts/master/com.drawelements.deqp.egl.xml b/android/cts/master/com.drawelements.deqp.egl.xml
index 73784a3..a44bebc 100644
--- a/android/cts/master/com.drawelements.deqp.egl.xml
+++ b/android/cts/master/com.drawelements.deqp.egl.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<TestPackage appPackageName="com.drawelements.deqp.egl" deqp:glesVersion="131072" name="dEQP-EGL" testType="deqpTest" xmlns:deqp="http://drawelements.com/deqp">
+<TestPackage appPackageName="com.drawelements.deqp.egl" deqp:glesVersion="131072" name="dEQP-EGL" runtimeHint="0" testType="deqpTest" xmlns:deqp="http://drawelements.com/deqp">
 	<TestSuite name="dEQP-EGL">
 		<TestCase name="info">
 			<Test name="version">
diff --git a/android/cts/master/com.drawelements.deqp.gles2.xml b/android/cts/master/com.drawelements.deqp.gles2.xml
index adbc036..00ab430 100644
--- a/android/cts/master/com.drawelements.deqp.gles2.xml
+++ b/android/cts/master/com.drawelements.deqp.gles2.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<TestPackage appPackageName="com.drawelements.deqp.gles2" deqp:glesVersion="131072" name="dEQP-GLES2" testType="deqpTest" xmlns:deqp="http://drawelements.com/deqp">
+<TestPackage appPackageName="com.drawelements.deqp.gles2" deqp:glesVersion="131072" name="dEQP-GLES2" runtimeHint="28" testType="deqpTest" xmlns:deqp="http://drawelements.com/deqp">
 	<TestSuite name="dEQP-GLES2">
 		<TestCase name="info">
 			<Test name="vendor">
diff --git a/android/cts/master/com.drawelements.deqp.gles3.xml b/android/cts/master/com.drawelements.deqp.gles3.xml
index f1f0120..a9eb016 100644
--- a/android/cts/master/com.drawelements.deqp.gles3.xml
+++ b/android/cts/master/com.drawelements.deqp.gles3.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<TestPackage appPackageName="com.drawelements.deqp.gles3" deqp:glesVersion="196608" name="dEQP-GLES3" testType="deqpTest" xmlns:deqp="http://drawelements.com/deqp">
+<TestPackage appPackageName="com.drawelements.deqp.gles3" deqp:glesVersion="196608" name="dEQP-GLES3" runtimeHint="180" testType="deqpTest" xmlns:deqp="http://drawelements.com/deqp">
 	<TestSuite name="dEQP-GLES3">
 		<TestCase name="info">
 			<Test name="vendor">
diff --git a/android/cts/master/com.drawelements.deqp.gles31.copy_image_compressed.xml b/android/cts/master/com.drawelements.deqp.gles31.copy_image_compressed.xml
index ac7c62c..490619b 100644
--- a/android/cts/master/com.drawelements.deqp.gles31.copy_image_compressed.xml
+++ b/android/cts/master/com.drawelements.deqp.gles31.copy_image_compressed.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<TestPackage appPackageName="com.drawelements.deqp.gles31.copy_image_compressed" deqp:glesVersion="196609" name="dEQP-GLES31" testType="deqpTest" xmlns:deqp="http://drawelements.com/deqp">
+<TestPackage appPackageName="com.drawelements.deqp.gles31.copy_image_compressed" deqp:glesVersion="196609" name="dEQP-GLES31" runtimeHint="40" testType="deqpTest" xmlns:deqp="http://drawelements.com/deqp">
 	<TestSuite name="dEQP-GLES31">
 		<TestSuite name="functional">
 			<TestSuite name="copy_image">
diff --git a/android/cts/master/com.drawelements.deqp.gles31.copy_image_mixed.xml b/android/cts/master/com.drawelements.deqp.gles31.copy_image_mixed.xml
index 394540c..5f4c473 100644
--- a/android/cts/master/com.drawelements.deqp.gles31.copy_image_mixed.xml
+++ b/android/cts/master/com.drawelements.deqp.gles31.copy_image_mixed.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<TestPackage appPackageName="com.drawelements.deqp.gles31.copy_image_mixed" deqp:glesVersion="196609" name="dEQP-GLES31" testType="deqpTest" xmlns:deqp="http://drawelements.com/deqp">
+<TestPackage appPackageName="com.drawelements.deqp.gles31.copy_image_mixed" deqp:glesVersion="196609" name="dEQP-GLES31" runtimeHint="140" testType="deqpTest" xmlns:deqp="http://drawelements.com/deqp">
 	<TestSuite name="dEQP-GLES31">
 		<TestSuite name="functional">
 			<TestSuite name="copy_image">
diff --git a/android/cts/master/com.drawelements.deqp.gles31.copy_image_non_compressed.xml b/android/cts/master/com.drawelements.deqp.gles31.copy_image_non_compressed.xml
index de0fd6d..43e7c93 100644
--- a/android/cts/master/com.drawelements.deqp.gles31.copy_image_non_compressed.xml
+++ b/android/cts/master/com.drawelements.deqp.gles31.copy_image_non_compressed.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<TestPackage appPackageName="com.drawelements.deqp.gles31.copy_image_non_compressed" deqp:glesVersion="196609" name="dEQP-GLES31" testType="deqpTest" xmlns:deqp="http://drawelements.com/deqp">
+<TestPackage appPackageName="com.drawelements.deqp.gles31.copy_image_non_compressed" deqp:glesVersion="196609" name="dEQP-GLES31" runtimeHint="290" testType="deqpTest" xmlns:deqp="http://drawelements.com/deqp">
 	<TestSuite name="dEQP-GLES31">
 		<TestSuite name="functional">
 			<TestSuite name="copy_image">
diff --git a/android/cts/master/com.drawelements.deqp.gles31.xml b/android/cts/master/com.drawelements.deqp.gles31.xml
index 5faef2e..402b7b6 100644
--- a/android/cts/master/com.drawelements.deqp.gles31.xml
+++ b/android/cts/master/com.drawelements.deqp.gles31.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<TestPackage appPackageName="com.drawelements.deqp.gles31" deqp:glesVersion="196609" name="dEQP-GLES31" testType="deqpTest" xmlns:deqp="http://drawelements.com/deqp">
+<TestPackage appPackageName="com.drawelements.deqp.gles31" deqp:glesVersion="196609" name="dEQP-GLES31" runtimeHint="45" testType="deqpTest" xmlns:deqp="http://drawelements.com/deqp">
 	<TestSuite name="dEQP-GLES31">
 		<TestCase name="info">
 			<Test name="vendor">
diff --git a/scripts/build_android_mustpass.py b/scripts/build_android_mustpass.py
index 058479b..635c518 100644
--- a/scripts/build_android_mustpass.py
+++ b/scripts/build_android_mustpass.py
@@ -41,9 +41,10 @@
 		self.filters		= filters
 
 class Package:
-	def __init__ (self, module, configurations, splitFilters = {}):
+	def __init__ (self, module, configurations, runtimeHint = None, splitFilters = {}):
 		self.module			= module
-		self.configurations	= configurations
+		self.configurations	        = configurations
+		self.runtimeHint	        = runtimeHint
 		# Map of name:[include filters]. Each will generate <api>.<name> package
 		# Test cases that didn't match any split filter will be in <api> package,
 		# i.e., the default value keeps everything in one package.
@@ -84,6 +85,11 @@
 	def encode (self):
 		return (self.major << 16) | (self.minor)
 
+class FilterHint:
+	def __init__(self, packageFilter, hint):
+		self.packageFilter = packageFilter
+		self.hint = hint
+
 def getModuleGLESVersion (module):
 	versions = {
 		'dEQP-EGL':		GLESVersion(2,0),
@@ -262,7 +268,7 @@
 	reparsed	= minidom.parseString(uglyString)
 	return reparsed.toprettyxml(indent='\t', encoding='utf-8')
 
-def genCTSPackageXML (package, root, name):
+def genCTSPackageXML (package, root, name, runtimeHint):
 	def isLeafGroup (testGroup):
 		numGroups	= 0
 		numTests	= 0
@@ -303,6 +309,8 @@
 								  appPackageName	= name,
 								  testType			= "deqpTest")
 
+	if runtimeHint:
+		pkgElem.set("runtimeHint", runtimeHint)
 	pkgElem.set("xmlns:deqp", "http://drawelements.com/deqp")
 	pkgElem.set("deqp:glesVersion", str(getModuleGLESVersion(package.module).encode()))
 
@@ -325,7 +333,7 @@
 
 	return mustpassElem
 
-def genCTSPackage (package, cases, matchingByConfig, packageName, xmlFilename):
+def genCTSPackage (package, cases, matchingByConfig, packageName, xmlFilename, runtimeHint):
 	root		= buildTestHierachy(cases)
 	testCaseMap	= buildTestCaseMap(root)
 
@@ -334,7 +342,7 @@
 			if case in testCaseMap:
 				testCaseMap[case].configurations.append(config)
 
-	packageXml	= genCTSPackageXML(package, root, packageName)
+	packageXml	= genCTSPackageXML(package, root, packageName, runtimeHint)
 
 	print "  Writing CTS caselist: " + xmlFilename
 	writeFile(xmlFilename, prettifyXML(packageXml))
@@ -361,19 +369,25 @@
 
 		allMatchingCases		= [c for c in allCasesInPkg if c in allMatchingSet] # To preserve ordering
 		splitFilters			= package.splitFilters
+                splitNoHints                    = [f.packageFilter for f in splitFilters.values()]
 		for splitName in splitFilters.keys():
-			splitIncludeFilters	= splitFilters[splitName]
+			splitIncludeFilters	     = splitFilters[splitName]
+			runtimeHint = "0"
+			if isinstance(splitIncludeFilters, FilterHint):
+				runtimeHint	        = splitIncludeFilters.hint
+				splitIncludeFilters	= splitIncludeFilters.packageFilter
 			splitCases			= applyInclude(allMatchingCases, splitIncludeFilters)
 			packageName			= getCTSPackageName(package, splitName)
 			xmlFilename			= os.path.join(CTS_DATA_DIR, mustpass.version, packageName + ".xml")
-			genCTSPackage(package, splitCases, matchingByConfig, packageName, xmlFilename)
+                        # if package.runtimeHint is None, do not set any runtime hints
+			genCTSPackage(package, splitCases, matchingByConfig, packageName, xmlFilename, runtimeHint if package.runtimeHint else None)
 
 		# The cases not matching any of the includes
-		combinedSplitFilters	= reduce(lambda x,y: x+y, splitFilters.values(), [])
+		combinedSplitFilters	= reduce(lambda x,y: x+y, splitNoHints, [])
 		restOfCases				= applyExclude(allMatchingCases, combinedSplitFilters)
 		packageName				= getCTSPackageName(package, None)
 		xmlFilename				= os.path.join(CTS_DATA_DIR, mustpass.version, packageName + ".xml")
-		genCTSPackage(package, restOfCases, matchingByConfig, packageName, xmlFilename)
+		genCTSPackage(package, restOfCases, matchingByConfig, packageName, xmlFilename, package.runtimeHint)
 
 	specXML			= genSpecXML(mustpass)
 	specFilename	= os.path.join(CTS_DATA_DIR, mustpass.version, "mustpass.xml")
@@ -438,7 +452,7 @@
 					  rotation		= "unspecified",
 					  surfacetype	= "window",
 					  filters		= MASTER_EGL_COMMON_FILTERS),
-	])
+	], runtimeHint = "0")
 
 MASTER_GLES2_COMMON_FILTERS		= [
 		include("gles2-master.txt"),
@@ -452,7 +466,7 @@
 					  rotation		= "unspecified",
 					  surfacetype	= "window",
 					  filters		= MASTER_GLES2_COMMON_FILTERS),
-	])
+	], runtimeHint = "28")
 
 MASTER_GLES3_COMMON_FILTERS		= [
 		include("gles3-master.txt"),
@@ -505,7 +519,7 @@
 					  surfacetype	= "window",
 					  filters		= MASTER_GLES3_COMMON_FILTERS + [include("gles3-pixelformat.txt"),
 																	 exclude("gles3-pixelformat-issues.txt")]),
-	])
+	], runtimeHint = "180")
 
 MASTER_GLES31_COMMON_FILTERS	= [
 		include("gles31-master.txt"),
@@ -558,9 +572,10 @@
 					  surfacetype	= "window",
 					  filters		= MASTER_GLES31_COMMON_FILTERS + [include("gles31-pixelformat.txt")]),
 	],
-	splitFilters = {"copy_image_compressed":			["dEQP-GLES31.functional.copy_image.compressed.*"],
-					"copy_image_non_compressed":		["dEQP-GLES31.functional.copy_image.non_compressed.*"],
-					"copy_image_mixed":					["dEQP-GLES31.functional.copy_image.mixed.*"],
+	runtimeHint = "45",
+	splitFilters = {"copy_image_compressed":			FilterHint(["dEQP-GLES31.functional.copy_image.compressed.*"], "40"),
+					"copy_image_non_compressed":		FilterHint(["dEQP-GLES31.functional.copy_image.non_compressed.*"], "290"),
+					"copy_image_mixed":					FilterHint(["dEQP-GLES31.functional.copy_image.mixed.*"], "140"),
 					}
 	)