mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 21:50:12 +01:00
egl/entrypoint-check: split sort-check into a function
Cc: mesa-stable Signed-off-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4448>
This commit is contained in:
parent
04bd58ff79
commit
351d513e30
1 changed files with 16 additions and 11 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue