[Mesa-dev] [PATCH mesa] glx: add GLXdispatchIndex sort check

Ilia Mirkin imirkin at alum.mit.edu
Wed Feb 22 01:12:03 UTC 2017


Please set lang=c to avoid any order issues.

On Feb 21, 2017 11:58 AM, "Eric Engestrom" <eric.engestrom at imgtec.com>
wrote:

> Signed-off-by: Eric Engestrom <eric.engestrom at imgtec.com>
> ---
>  src/glx/tests/Makefile.am          |  2 +-
>  src/glx/tests/dispatch-index-check | 24 ++++++++++++++++++++++++
>  2 files changed, 25 insertions(+), 1 deletion(-)
>  create mode 100755 src/glx/tests/dispatch-index-check
>
> diff --git a/src/glx/tests/Makefile.am b/src/glx/tests/Makefile.am
> index bdc78c0d5a..8874c20b01 100644
> --- a/src/glx/tests/Makefile.am
> +++ b/src/glx/tests/Makefile.am
> @@ -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 =                     \
> diff --git a/src/glx/tests/dispatch-index-check b/src/glx/tests/dispatch-
> index-check
> new file mode 100755
> index 0000000000..e2b5faff09
> --- /dev/null
> +++ b/src/glx/tests/dispatch-index-check
> @@ -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=$(sort <<< "$dispatch_list")
> +
> +test "$dispatch_list" = "$sorted"
> --
> Cheers,
>   Eric
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170221/2048f51f/attachment-0002.html>


More information about the mesa-dev mailing list