1# Copyright © 2017 Intel Corporation
2
3# Permission is hereby granted, free of charge, to any person obtaining a copy
4# of this software and associated documentation files (the "Software"), to deal
5# in the Software without restriction, including without limitation the rights
6# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7# copies of the Software, and to permit persons to whom the Software is
8# furnished to do so, subject to the following conditions:
9
10# The above copyright notice and this permission notice shall be included in
11# all copies or substantial portions of the Software.
12
13# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19# SOFTWARE.
20
21test(
22  'general_ir_test',
23  executable(
24    'general_ir_test',
25    ['array_refcount_test.cpp', 'builtin_variable_test.cpp',
26     'invalidate_locations_test.cpp', 'general_ir_test.cpp',
27     'lower_int64_test.cpp', 'opt_add_neg_to_sub_test.cpp',
28     'varyings_test.cpp', ir_expression_operation_h],
29    cpp_args : [cpp_msvc_compat_args],
30    gnu_symbol_visibility : 'hidden',
31    include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_glsl],
32    link_with : [libglsl, libglsl_standalone, libglsl_util],
33    dependencies : [dep_clock, dep_thread, idep_gtest, idep_mesautil],
34  ),
35  suite : ['compiler', 'glsl'],
36)
37
38test(
39  'uniform_initializer_test',
40  executable(
41    'uniform_initializer_test',
42    ['copy_constant_to_storage_tests.cpp', 'set_uniform_initializer_tests.cpp',
43     'uniform_initializer_utils.cpp', 'uniform_initializer_utils.h',
44     ir_expression_operation_h],
45    cpp_args : [cpp_msvc_compat_args],
46    gnu_symbol_visibility : 'hidden',
47    include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_glsl],
48    link_with : [libglsl, libglsl_util],
49    dependencies : [dep_thread, idep_gtest, idep_mesautil],
50  ),
51  suite : ['compiler', 'glsl'],
52)
53
54test(
55  'sampler_types_test',
56  executable(
57    'sampler_types_test',
58    ['sampler_types_test.cpp', ir_expression_operation_h],
59    cpp_args : [cpp_msvc_compat_args],
60    gnu_symbol_visibility : 'hidden',
61    include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_glsl],
62    link_with : [libglsl, libglsl_util],
63    dependencies : [dep_thread, idep_gtest, idep_mesautil],
64  ),
65  suite : ['compiler', 'glsl'],
66)
67
68test(
69  'list_iterators',
70  executable(
71    'list_iterators',
72    ['list_iterators.cpp'],
73    cpp_args : [cpp_msvc_compat_args],
74    gnu_symbol_visibility : 'hidden',
75    include_directories : [inc_include, inc_src, inc_glsl],
76    link_with : [libglsl, libglsl_util],
77    dependencies : [dep_thread, idep_gtest],
78  ),
79  suite : ['compiler', 'glsl'],
80)
81
82# Meson can't auto-skip these on cross builds because of the python wrapper
83#
84# TODO: has_exe_wrapper() is deprecated and renamed to can_run_host_binaries()
85# starting with Meson 0.55.0
86if meson.has_exe_wrapper()
87  test(
88    'glsl compiler warnings',
89    prog_python,
90    args : [
91      join_paths(meson.current_source_dir(), 'warnings_test.py'),
92      '--glsl-compiler', glsl_compiler,
93      '--test-directory', join_paths(
94        meson.source_root(), 'src', 'compiler', 'glsl', 'tests', 'warnings'
95      ),
96    ],
97    suite : ['compiler', 'glsl'],
98    timeout: 60,
99  )
100
101  test(
102    'glsl optimization',
103    prog_python,
104    args : [
105      join_paths(meson.current_source_dir(), 'optimization_test.py'),
106      '--test-runner', glsl_test
107    ],
108    suite : ['compiler', 'glsl'],
109  )
110endif
111
112if with_tools.contains('glsl')
113  test(
114    'glsl dump-builder test',
115    glsl_compiler,
116    args : ['--version', '110', '--dump-builder',
117            join_paths(meson.current_source_dir(), 'standalone_dump-builder.frag'),
118           ],
119    suite : ['compiler', 'glsl'],
120  )
121  test(
122    'glsl lower-precision test',
123    prog_python,
124    args : [join_paths(meson.current_source_dir(), 'lower_precision_test.py'),
125            glsl_compiler
126           ],
127    suite : ['compiler', 'glsl'],
128  )
129endif
130