check: mark two tests are requiring bash
[mesa.git] / src / glx / tests / dispatch-index-check
1 #!/usr/bin/env bash
2
3 # extract enum definition
4 dispatch_list=$(sed '/__GLXdispatchIndex/,/__GLXdispatchIndex/!d' \
5 "$srcdir"/../g_glxglvnddispatchindices.h)
6
7 # extract values inside of enum
8 dispatch_list=$(sed '1d;$d' <<< "$dispatch_list")
9
10 # remove indentation
11 dispatch_list=$(sed 's/^\s\+//' <<< "$dispatch_list")
12
13 # extract function names
14 dispatch_list=$(sed 's/DI_//;s/,//' <<< "$dispatch_list")
15
16 # same for commented functions, we want to keep them sorted too
17 dispatch_list=$(sed 's#// ##;s/ implemented by [a-z]\+//' <<< "$dispatch_list")
18
19 # remove LAST_INDEX, as it will not be in alphabetical order
20 dispatch_list=$(sed '/LAST_INDEX/d' <<< "$dispatch_list")
21
22 sorted=$(LC_ALL=C sort <<< "$dispatch_list")
23
24 test "$dispatch_list" = "$sorted"