mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 17:30:12 +01:00
glx: add GLXdispatchIndex sort check
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
This commit is contained in:
parent
caf4252a01
commit
3cc33e7640
2 changed files with 25 additions and 1 deletions
|
|
@ -12,7 +12,7 @@ AM_CPPFLAGS = \
|
|||
$(LIBDRM_CFLAGS) \
|
||||
$(X11_INCLUDES)
|
||||
|
||||
TESTS = glx-test
|
||||
TESTS = glx-test dispatch-index-check
|
||||
check_PROGRAMS = glx-test
|
||||
|
||||
glx_test_SOURCES = \
|
||||
|
|
|
|||
24
src/glx/tests/dispatch-index-check
Executable file
24
src/glx/tests/dispatch-index-check
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/sh
|
||||
|
||||
# extract enum definition
|
||||
dispatch_list=$(sed '/__GLXdispatchIndex/,/__GLXdispatchIndex/!d' \
|
||||
"$srcdir"/../g_glxglvnddispatchindices.h)
|
||||
|
||||
# extract values inside of enum
|
||||
dispatch_list=$(sed '1d;$d' <<< "$dispatch_list")
|
||||
|
||||
# remove indentation
|
||||
dispatch_list=$(sed 's/^\s\+//' <<< "$dispatch_list")
|
||||
|
||||
# extract function names
|
||||
dispatch_list=$(sed 's/DI_//;s/,//' <<< "$dispatch_list")
|
||||
|
||||
# same for commented functions, we want to keep them sorted too
|
||||
dispatch_list=$(sed 's#// ##;s/ implemented by [a-z]\+//' <<< "$dispatch_list")
|
||||
|
||||
# remove LAST_INDEX, as it will not be in alphabetical order
|
||||
dispatch_list=$(sed '/LAST_INDEX/d' <<< "$dispatch_list")
|
||||
|
||||
sorted=$(LC_ALL=C sort <<< "$dispatch_list")
|
||||
|
||||
test "$dispatch_list" = "$sorted"
|
||||
Loading…
Add table
Reference in a new issue