1# -*- coding: utf-8 -*-
2
3#-------------------------------------------------------------------------
4# drawElements Quality Program utilities
5# --------------------------------------
6#
7# Copyright 2015 The Android Open Source Project
8#
9# Licensed under the Apache License, Version 2.0 (the "License");
10# you may not use this file except in compliance with the License.
11# You may obtain a copy of the License at
12#
13#      http://www.apache.org/licenses/LICENSE-2.0
14#
15# Unless required by applicable law or agreed to in writing, software
16# distributed under the License is distributed on an "AS IS" BASIS,
17# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18# See the License for the specific language governing permissions and
19# limitations under the License.
20#
21#-------------------------------------------------------------------------
22
23from ctsbuild.common import DEQP_DIR
24from ctsbuild.config import ANY_GENERATOR
25from build_caselists import Module, getModuleByName, getBuildConfig, DEFAULT_BUILD_DIR, DEFAULT_TARGET
26from mustpass import Project, Package, Mustpass, Configuration, include, exclude, genMustpassLists, parseBuildConfigFromCmdLineArgs
27
28import os
29
30COPYRIGHT_DECLARATION = """
31     Copyright (C) 2016 The Android Open Source Project
32
33     Licensed under the Apache License, Version 2.0 (the "License");
34     you may not use this file except in compliance with the License.
35     You may obtain a copy of the License at
36
37          http://www.apache.org/licenses/LICENSE-2.0
38
39     Unless required by applicable law or agreed to in writing, software
40     distributed under the License is distributed on an "AS IS" BASIS,
41     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
42     See the License for the specific language governing permissions and
43     limitations under the License.
44     """
45
46CTS_DATA_DIR					= os.path.join(DEQP_DIR, "android", "cts")
47
48CTS_PROJECT						= Project(path = CTS_DATA_DIR, copyright = COPYRIGHT_DECLARATION)
49
50EGL_MODULE						= getModuleByName("dEQP-EGL")
51GLES2_MODULE					= getModuleByName("dEQP-GLES2")
52GLES3_MODULE					= getModuleByName("dEQP-GLES3")
53GLES31_MODULE					= getModuleByName("dEQP-GLES31")
54VULKAN_MODULE					= getModuleByName("dEQP-VK")
55
56# Main
57
58MAIN_EGL_COMMON_FILTERS		= [include("egl-master.txt"),
59								   exclude("egl-test-issues.txt"),
60								   exclude("egl-manual-robustness.txt"),
61								   exclude("egl-driver-issues.txt"),
62								   exclude("egl-temp-excluded.txt")]
63
64# Android CTS is not using EGL test list for year 2021
65MAIN_EGL_PKG					= Package(module = EGL_MODULE, configurations = [
66		Configuration(name			= "master-2020-03-01",
67					  glconfig		= "rgba8888d24s8ms0",
68					  rotation		= "unspecified",
69					  surfacetype	= "window",
70					  required		= True,
71					  filters		= [include("egl-master-2020-03-01.txt")],
72					  runtime		= "23m"),
73		Configuration(name			= "master-2022-03-01",
74					  glconfig		= "rgba8888d24s8ms0",
75					  rotation		= "unspecified",
76					  surfacetype	= "window",
77					  required		= True,
78					  filters		= [include("egl-master-2022-03-01.txt")],
79					  runtime		= "5m"),
80		Configuration(name			= "master-2023-03-01",
81					  glconfig		= "rgba8888d24s8ms0",
82					  rotation		= "unspecified",
83					  surfacetype	= "window",
84					  required		= True,
85					  filters		= [include("egl-master-2023-03-01.txt")],
86					  runtime		= "5m"),
87		Configuration(name			= "master-2024-03-01",
88					  glconfig		= "rgba8888d24s8ms0",
89					  rotation		= "unspecified",
90					  surfacetype	= "window",
91					  required		= True,
92					  filters		= MAIN_EGL_COMMON_FILTERS + [exclude("egl-master-2020-03-01.txt", "egl-master-2022-03-01.txt", "egl-master-2023-03-01.txt")],
93					  runtime		= "5m"),
94		# Risky subset
95		Configuration(name			= "master-risky",
96					  glconfig		= "rgba8888d24s8ms0",
97					  rotation		= "unspecified",
98					  surfacetype	= "window",
99					  required		= True,
100					  filters		= [include("egl-temp-excluded.txt")],
101					  runtime		= "2m"),
102	])
103
104MAIN_GLES2_COMMON_FILTERS		= [
105		include("gles2-master.txt"),
106		exclude("gles2-test-issues.txt"),
107		exclude("gles2-failures.txt"),
108		exclude("gles2-temp-excluded.txt"),
109	]
110MAIN_GLES2_PKG				= Package(module = GLES2_MODULE, configurations = [
111		Configuration(name			= "master-2020-03-01",
112					  glconfig		= "rgba8888d24s8ms0",
113					  rotation		= "unspecified",
114					  surfacetype	= "window",
115					  required		= True,
116					  filters		= [include("gles2-master-2020-03-01.txt")],
117					  runtime		= "46m"),
118		Configuration(name			= "master-2021-03-01",
119					  glconfig		= "rgba8888d24s8ms0",
120					  rotation		= "unspecified",
121					  surfacetype	= "window",
122					  required		= True,
123					  filters		= [include("gles2-master-2021-03-01.txt")],
124					  runtime		= "10m"),
125		Configuration(name			= "master-2022-03-01",
126					  glconfig		= "rgba8888d24s8ms0",
127					  rotation		= "unspecified",
128					  surfacetype	= "window",
129					  required		= True,
130					  filters		= [include("gles2-master-2022-03-01.txt")],
131					  runtime		= "10m"),
132		Configuration(name			= "master-2023-03-01",
133					  glconfig		= "rgba8888d24s8ms0",
134					  rotation		= "unspecified",
135					  surfacetype	= "window",
136					  required		= True,
137					  filters		= [include("gles2-master-2023-03-01.txt")],
138					  runtime		= "10m"),
139		Configuration(name			= "master-2024-03-01",
140					  glconfig		= "rgba8888d24s8ms0",
141					  rotation		= "unspecified",
142					  surfacetype	= "window",
143					  required		= True,
144					  filters		= MAIN_GLES2_COMMON_FILTERS + [exclude("gles2-master-2020-03-01.txt", "gles2-master-2021-03-01.txt", "gles2-master-2022-03-01.txt", "gles2-master-2023-03-01.txt")],
145					  runtime		= "10m"),
146	])
147
148MAIN_GLES3_COMMON_FILTERS		= [
149		include("gles3-master.txt"),
150		exclude("gles3-hw-issues.txt"),
151		exclude("gles3-driver-issues.txt"),
152		exclude("gles3-test-issues.txt"),
153		exclude("gles3-spec-issues.txt"),
154		exclude("gles3-temp-excluded.txt"),
155		exclude("gles3-waivers.txt"),
156	]
157MAIN_GLES3_PKG				= Package(module = GLES3_MODULE, configurations = [
158		# Main
159		Configuration(name			= "master-2020-03-01",
160					  glconfig		= "rgba8888d24s8ms0",
161					  rotation		= "unspecified",
162					  surfacetype	= "window",
163					  required		= True,
164					  filters		= [include("gles3-master-2020-03-01.txt")],
165					  runtime		= "1h50m"),
166		Configuration(name			= "master-2021-03-01",
167					  glconfig		= "rgba8888d24s8ms0",
168					  rotation		= "unspecified",
169					  surfacetype	= "window",
170					  required		= True,
171					  filters		= [include("gles3-master-2021-03-01.txt")],
172					  runtime		= "10m"),
173		Configuration(name			= "master-2022-03-01",
174					  glconfig		= "rgba8888d24s8ms0",
175					  rotation		= "unspecified",
176					  surfacetype	= "window",
177					  required		= True,
178					  filters		= [include("gles3-master-2022-03-01.txt")],
179					  runtime		= "10m"),
180		Configuration(name			= "master-2023-03-01",
181					  glconfig		= "rgba8888d24s8ms0",
182					  rotation		= "unspecified",
183					  surfacetype	= "window",
184					  required		= True,
185					  filters		= [include("gles3-master-2023-03-01.txt")],
186					  runtime		= "10m"),
187		Configuration(name			= "master-2024-03-01",
188					  glconfig		= "rgba8888d24s8ms0",
189					  rotation		= "unspecified",
190					  surfacetype	= "window",
191					  required		= True,
192					  filters		= MAIN_GLES3_COMMON_FILTERS + [exclude("gles3-master-2020-03-01.txt", "gles3-master-2021-03-01.txt", "gles3-master-2022-03-01.txt", "gles3-master-2023-03-01.txt")],
193					  runtime		= "10m"),
194		# Rotations
195		Configuration(name			= "rotate-portrait",
196					  glconfig		= "rgba8888d24s8ms0",
197					  rotation		= "0",
198					  surfacetype	= "window",
199					  filters		= MAIN_GLES3_COMMON_FILTERS + [include("gles3-rotation.txt")],
200					  runtime		= "1m"),
201		Configuration(name			= "rotate-landscape",
202					  glconfig		= "rgba8888d24s8ms0",
203					  rotation		= "90",
204					  surfacetype	= "window",
205					  filters		= MAIN_GLES3_COMMON_FILTERS + [include("gles3-rotation.txt")],
206					  runtime		= "1m"),
207		Configuration(name			= "rotate-reverse-portrait",
208					  glconfig		= "rgba8888d24s8ms0",
209					  rotation		= "180",
210					  surfacetype	= "window",
211					  filters		= MAIN_GLES3_COMMON_FILTERS + [include("gles3-rotation.txt")],
212					  runtime		= "1m"),
213		Configuration(name			= "rotate-reverse-landscape",
214					  glconfig		= "rgba8888d24s8ms0",
215					  rotation		= "270",
216					  surfacetype	= "window",
217					  filters		= MAIN_GLES3_COMMON_FILTERS + [include("gles3-rotation.txt")],
218					  runtime		= "1m"),
219
220		# MSAA
221		Configuration(name			= "multisample",
222					  glconfig		= "rgba8888d24s8ms4",
223					  rotation		= "unspecified",
224					  surfacetype	= "window",
225					  filters		= MAIN_GLES3_COMMON_FILTERS + [include("gles3-multisample.txt"),
226																	 exclude("gles3-multisample-issues.txt")],
227					  runtime		= "1m"),
228
229		# Pixel format
230		Configuration(name			= "565-no-depth-no-stencil",
231					  glconfig		= "rgb565d0s0ms0",
232					  rotation		= "unspecified",
233					  surfacetype	= "window",
234					  filters		= MAIN_GLES3_COMMON_FILTERS + [include("gles3-pixelformat.txt"),
235																	 exclude("gles3-pixelformat-issues.txt")],
236					  runtime		= "1m"),
237		# Incremental dEQP
238		Configuration(name			= "incremental-deqp",
239					  filters		= [include("gles3-incremental-deqp.txt")],
240					  runtime		= "5m",
241					  runByDefault	= False),
242	])
243
244MAIN_GLES31_COMMON_FILTERS	= [
245		include("gles31-master.txt"),
246		exclude("gles31-hw-issues.txt"),
247		exclude("gles31-driver-issues.txt"),
248		exclude("gles31-test-issues.txt"),
249		exclude("gles31-spec-issues.txt"),
250		exclude("gles31-temp-excluded.txt"),
251		exclude("gles31-waivers.txt"),
252	]
253MAIN_GLES31_PKG				= Package(module = GLES31_MODULE, configurations = [
254		Configuration(name			= "master-2020-03-01",
255					  glconfig		= "rgba8888d24s8ms0",
256					  rotation		= "unspecified",
257					  surfacetype	= "window",
258					  required		= True,
259					  filters		= [include("gles31-master-2020-03-01.txt")],
260					  runtime		= "1h40m"),
261		Configuration(name			= "master-2021-03-01",
262					  glconfig		= "rgba8888d24s8ms0",
263					  rotation		= "unspecified",
264					  surfacetype	= "window",
265					  required		= True,
266					  filters		= [include("gles31-master-2021-03-01.txt")],
267					  runtime		= "10m"),
268		Configuration(name			= "master-2022-03-01",
269					  glconfig		= "rgba8888d24s8ms0",
270					  rotation		= "unspecified",
271					  surfacetype	= "window",
272					  required		= True,
273					  filters		= [include("gles31-master-2022-03-01.txt")],
274					  runtime		= "10m"),
275		Configuration(name			= "master-2023-03-01",
276					  glconfig		= "rgba8888d24s8ms0",
277					  rotation		= "unspecified",
278					  surfacetype	= "window",
279					  required		= True,
280					  filters		= [include("gles31-master-2023-03-01.txt")],
281					  runtime		= "10m"),
282		Configuration(name			= "master-2024-03-01",
283					  glconfig		= "rgba8888d24s8ms0",
284					  rotation		= "unspecified",
285					  surfacetype	= "window",
286					  required		= True,
287					  filters		= MAIN_GLES31_COMMON_FILTERS + [exclude("gles31-master-2020-03-01.txt", "gles31-master-2021-03-01.txt", "gles31-master-2022-03-01.txt", "gles31-master-2023-03-01.txt")],
288					  runtime		= "10m"),
289		# Rotations
290		Configuration(name			= "rotate-portrait",
291					  glconfig		= "rgba8888d24s8ms0",
292					  rotation		= "0",
293					  surfacetype	= "window",
294					  filters		= MAIN_GLES31_COMMON_FILTERS + [include("gles31-rotation.txt")],
295					  runtime		= "1m30s"),
296		Configuration(name			= "rotate-landscape",
297					  glconfig		= "rgba8888d24s8ms0",
298					  rotation		= "90",
299					  surfacetype	= "window",
300					  filters		= MAIN_GLES31_COMMON_FILTERS + [include("gles31-rotation.txt")],
301					  runtime		= "1m30s"),
302		Configuration(name			= "rotate-reverse-portrait",
303					  glconfig		= "rgba8888d24s8ms0",
304					  rotation		= "180",
305					  surfacetype	= "window",
306					  filters		= MAIN_GLES31_COMMON_FILTERS + [include("gles31-rotation.txt")],
307					  runtime		= "1m30s"),
308		Configuration(name			= "rotate-reverse-landscape",
309					  glconfig		= "rgba8888d24s8ms0",
310					  rotation		= "270",
311					  surfacetype	= "window",
312					  filters		= MAIN_GLES31_COMMON_FILTERS + [include("gles31-rotation.txt")],
313					  runtime		= "1m30s"),
314
315		# MSAA
316		Configuration(name			= "multisample",
317					  glconfig		= "rgba8888d24s8ms4",
318					  rotation		= "unspecified",
319					  surfacetype	= "window",
320					  filters		= MAIN_GLES31_COMMON_FILTERS + [include("gles31-multisample.txt")],
321					  runtime		= "2m"),
322
323		# Pixel format
324		Configuration(name			= "565-no-depth-no-stencil",
325					  glconfig		= "rgb565d0s0ms0",
326					  rotation		= "unspecified",
327					  surfacetype	= "window",
328					  filters		= MAIN_GLES31_COMMON_FILTERS + [include("gles31-pixelformat.txt")],
329					  runtime		= "1m"),
330	])
331
332MAIN_VULKAN_FILTERS			= [
333		include("vk-master.txt"),
334		exclude("vk-not-applicable.txt"),
335		exclude("vk-excluded-tests.txt"),
336		exclude("vk-test-issues.txt"),
337		exclude("vk-waivers.txt"),
338		exclude("vk-temp-excluded.txt"),
339	]
340MAIN_VULKAN_PKG				= Package(module = VULKAN_MODULE, configurations = [
341		Configuration(name					= "master-2019-03-01",
342					  filters				= [include("vk-master-2019-03-01.txt")],
343					  runtime				= "2h29m",
344					  listOfGroupsToSplit	= ["dEQP-VK"]),
345		Configuration(name					= "master-2020-03-01",
346					  filters				= [include("vk-master-2020-03-01.txt")],
347					  runtime				= "2h29m",
348					  listOfGroupsToSplit	= ["dEQP-VK"]),
349		Configuration(name					= "master-2021-03-01",
350					  filters				= [include("vk-master-2021-03-01.txt")],
351					  runtime				= "2h29m",
352					  listOfGroupsToSplit	= ["dEQP-VK"]),
353		Configuration(name					= "master-2022-03-01",
354					  filters				= [include("vk-master-2022-03-01.txt")],
355					  runtime				= "10m",
356					  listOfGroupsToSplit	= ["dEQP-VK", "dEQP-VK.pipeline", "dEQP-VK.image", "dEQP-VK.shader_object"]),
357		Configuration(name					= "master-2023-03-01",
358					  filters				= [include("vk-master-2023-03-01-part1.txt", "vk-master-2023-03-01-part2.txt")],
359					  runtime				= "10m",
360					  listOfGroupsToSplit	= ["dEQP-VK", "dEQP-VK.pipeline", "dEQP-VK.image", "dEQP-VK.shader_object"]),
361		Configuration(name					= "master-2024-03-01",
362					  filters				= MAIN_VULKAN_FILTERS + [exclude("vk-master-2019-03-01.txt", "vk-master-2020-03-01.txt", "vk-master-2021-03-01.txt", "vk-master-2022-03-01.txt", "vk-master-2023-03-01-part1.txt", "vk-master-2023-03-01-part2.txt")],
363					  runtime				= "10m",
364					  listOfGroupsToSplit	= ["dEQP-VK", "dEQP-VK.pipeline", "dEQP-VK.image", "dEQP-VK.shader_object"]),
365		Configuration(name					= "incremental-deqp",
366					  filters				= [include("vk-incremental-deqp.txt")],
367					  runtime				= "5m",
368					  runByDefault			= False,
369					  listOfGroupsToSplit	= ["dEQP-VK"]),
370	])
371
372MUSTPASS_LISTS				= [
373		Mustpass(project = CTS_PROJECT, version = "main",		packages = [MAIN_EGL_PKG, MAIN_GLES2_PKG, MAIN_GLES3_PKG, MAIN_GLES31_PKG, MAIN_VULKAN_PKG])
374	]
375
376if __name__ == "__main__":
377	genMustpassLists(MUSTPASS_LISTS, ANY_GENERATOR, parseBuildConfigFromCmdLineArgs())
378