3 # VK-GL-CTS log scrubber
4 # ----------------------
6 # Copyright (c) 2019 The Khronos Group Inc.
7 # Copyright (c) 2019 Google LLC
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
13 # http://www.apache.org/licenses/LICENSE-2.0
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.
21 # This script attempts to find out which tests have changed since a
22 # certain time, release or changelist. The commit messages are scrubbed
23 # for dEQP test names, and these are merged to find a suitable set.
25 # The changelists that claim to change all tests are ignored.
32 assert sys.version_info >= (3, 0)
34 if len(sys.argv) == 1:
36 VK-GL-CTS log scrubber
37 ----------------------
38 This script attempts to list changed tests since certain time or
39 git revision. It does this by looking at git log.
41 Caveat: git log messages are written by humans, so there may be
42 errors. Overly broad changes are ignored (e.g, dEQP-VK.*).
44 Usage: Give the git log parameters
47 print(sys.argv[0], '--since="two months ago"')
48 print(sys.argv[0], '--since="7.7.2019"')
49 print(sys.argv[0], 'vulkan-cts-1.1.3.1..HEAD')
54 for x in sys.argv[1:]:
62 rawlogoutput = subprocess.check_output(['git', 'log', params, '--pretty=format:"%B"'])
63 logoutput = rawlogoutput.decode().split()
66 # regexp matches various over-large test masks like "dEQP-*", "dEQP-VK*", "dEQP-VK.*",
67 # but not "dEQP-VK.a" or "dEQP-VK.*a"
68 if xs.startswith('dEQP-') and not re.search('dEQP-\w*\**\.*\**$',xs):
72 if fnmatch.fnmatch(xs, y):
74 if fnmatch.fnmatch(y, xs):
82 print(len(res), 'total')