Module: Mesa Branch: staging/20.1 Commit: ef5383469a6c6df3be4ebffe18efbbaa4b995949 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ef5383469a6c6df3be4ebffe18efbbaa4b995949
Author: Eric Engestrom <[email protected]> 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 <[email protected]> Reviewed-by: Emil Velikov <[email protected]> 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 bf0aeebf189..3b2e26d3514 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -13,7 +13,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() _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
