Mesa (staging/20.2): egl/entrypoint-check: split sort-check into a function
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Aug 11 16:44:11 UTC 2020
Module: Mesa
Branch: staging/20.2
Commit: 53f5f43627b369ede29a8efcff1318bb03796aa1
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=53f5f43627b369ede29a8efcff1318bb03796aa1
Author: Eric Engestrom <eric at engestrom.ch>
Date: Fri Apr 3 12:23:27 2020 +0200
egl/entrypoint-check: split sort-check into a function
Cc: mesa-stable
Signed-off-by: Eric Engestrom <eric at engestrom.ch>
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4448>
(cherry picked from commit 351d513e30b3d09f39ee73169fc68e7cdaca1d11)
---
.pick_status.json | 2 +-
src/egl/egl-entrypoint-check.py | 27 ++++++++++++++++-----------
2 files changed, 17 insertions(+), 12 deletions(-)
diff --git a/.pick_status.json b/.pick_status.json
index ede3d4ec59e..3083bd95b82 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -463,7 +463,7 @@
"description": "egl/entrypoint-check: split sort-check into a function",
"nominated": true,
"nomination_type": 0,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": null
},
diff --git a/src/egl/egl-entrypoint-check.py b/src/egl/egl-entrypoint-check.py
index 1e876615028..7cbb8a7708a 100644
--- a/src/egl/egl-entrypoint-check.py
+++ b/src/egl/egl-entrypoint-check.py
@@ -5,6 +5,21 @@ import argparse
PREFIX = 'EGL_ENTRYPOINT('
SUFFIX = ')'
+
+def check_entrypoint_sorted(entrypoints):
+ print('Checking that EGL API entrypoints are sorted...')
+
+ for i, _ in enumerate(entrypoints):
+ # Can't compare the first one with the previous
+ if i == 0:
+ continue
+ if entrypoints[i - 1] > entrypoints[i]:
+ print('ERROR: ' + entrypoints[i] + ' should come before ' + entrypoints[i - 1])
+ exit(1)
+
+ print('All good :)')
+
+
def main():
parser = argparse.ArgumentParser()
parser.add_argument('header')
@@ -20,17 +35,7 @@ def main():
assert line.endswith(SUFFIX)
entrypoints.append(line[len(PREFIX):-len(SUFFIX)])
- print('Checking EGL API entrypoints are sorted')
-
- for i, _ in enumerate(entrypoints):
- # Can't compare the first one with the previous
- if i == 0:
- continue
- if entrypoints[i - 1] > entrypoints[i]:
- print('ERROR: ' + entrypoints[i] + ' should come before ' + entrypoints[i - 1])
- exit(1)
-
- print('All good :)')
+ check_entrypoint_sorted(entrypoints)
if __name__ == '__main__':
main()
More information about the mesa-commit
mailing list