101e04c3fSmrg# Copyright © 2017 Intel Corporation
201e04c3fSmrg
301e04c3fSmrg# Permission is hereby granted, free of charge, to any person obtaining a copy
401e04c3fSmrg# of this software and associated documentation files (the "Software"), to deal
501e04c3fSmrg# in the Software without restriction, including without limitation the rights
601e04c3fSmrg# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
701e04c3fSmrg# copies of the Software, and to permit persons to whom the Software is
801e04c3fSmrg# furnished to do so, subject to the following conditions:
901e04c3fSmrg
1001e04c3fSmrg# The above copyright notice and this permission notice shall be included in
1101e04c3fSmrg# all copies or substantial portions of the Software.
1201e04c3fSmrg
1301e04c3fSmrg# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1401e04c3fSmrg# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1501e04c3fSmrg# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1601e04c3fSmrg# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1701e04c3fSmrg# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1801e04c3fSmrg# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1901e04c3fSmrg# SOFTWARE.
2001e04c3fSmrg
2101e04c3fSmrgtest(
2201e04c3fSmrg  'general_ir_test',
2301e04c3fSmrg  executable(
2401e04c3fSmrg    'general_ir_test',
2501e04c3fSmrg    ['array_refcount_test.cpp', 'builtin_variable_test.cpp',
2601e04c3fSmrg     'invalidate_locations_test.cpp', 'general_ir_test.cpp',
2701e04c3fSmrg     'lower_int64_test.cpp', 'opt_add_neg_to_sub_test.cpp',
2801e04c3fSmrg     'varyings_test.cpp', ir_expression_operation_h],
297ec681f3Smrg    cpp_args : [cpp_msvc_compat_args],
307ec681f3Smrg    gnu_symbol_visibility : 'hidden',
317ec681f3Smrg    include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_glsl],
3201e04c3fSmrg    link_with : [libglsl, libglsl_standalone, libglsl_util],
337ec681f3Smrg    dependencies : [dep_clock, dep_thread, idep_gtest, idep_mesautil],
347e102996Smaya  ),
357e102996Smaya  suite : ['compiler', 'glsl'],
3601e04c3fSmrg)
3701e04c3fSmrg
3801e04c3fSmrgtest(
3901e04c3fSmrg  'uniform_initializer_test',
4001e04c3fSmrg  executable(
4101e04c3fSmrg    'uniform_initializer_test',
4201e04c3fSmrg    ['copy_constant_to_storage_tests.cpp', 'set_uniform_initializer_tests.cpp',
4301e04c3fSmrg     'uniform_initializer_utils.cpp', 'uniform_initializer_utils.h',
4401e04c3fSmrg     ir_expression_operation_h],
457ec681f3Smrg    cpp_args : [cpp_msvc_compat_args],
467ec681f3Smrg    gnu_symbol_visibility : 'hidden',
477ec681f3Smrg    include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_glsl],
4801e04c3fSmrg    link_with : [libglsl, libglsl_util],
497ec681f3Smrg    dependencies : [dep_thread, idep_gtest, idep_mesautil],
507e102996Smaya  ),
517e102996Smaya  suite : ['compiler', 'glsl'],
5201e04c3fSmrg)
5301e04c3fSmrg
5401e04c3fSmrgtest(
5501e04c3fSmrg  'sampler_types_test',
5601e04c3fSmrg  executable(
5701e04c3fSmrg    'sampler_types_test',
5801e04c3fSmrg    ['sampler_types_test.cpp', ir_expression_operation_h],
597ec681f3Smrg    cpp_args : [cpp_msvc_compat_args],
607ec681f3Smrg    gnu_symbol_visibility : 'hidden',
617ec681f3Smrg    include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_glsl],
6201e04c3fSmrg    link_with : [libglsl, libglsl_util],
637ec681f3Smrg    dependencies : [dep_thread, idep_gtest, idep_mesautil],
647e102996Smaya  ),
657e102996Smaya  suite : ['compiler', 'glsl'],
6601e04c3fSmrg)
6701e04c3fSmrg
6801e04c3fSmrgtest(
697ec681f3Smrg  'list_iterators',
707ec681f3Smrg  executable(
717ec681f3Smrg    'list_iterators',
727ec681f3Smrg    ['list_iterators.cpp'],
737ec681f3Smrg    cpp_args : [cpp_msvc_compat_args],
747ec681f3Smrg    gnu_symbol_visibility : 'hidden',
757ec681f3Smrg    include_directories : [inc_include, inc_src, inc_glsl],
767ec681f3Smrg    link_with : [libglsl, libglsl_util],
777ec681f3Smrg    dependencies : [dep_thread, idep_gtest],
787ec681f3Smrg  ),
797e102996Smaya  suite : ['compiler', 'glsl'],
8001e04c3fSmrg)
817e102996Smaya
827ec681f3Smrg# Meson can't auto-skip these on cross builds because of the python wrapper
837ec681f3Smrg#
847ec681f3Smrg# TODO: has_exe_wrapper() is deprecated and renamed to can_run_host_binaries()
857ec681f3Smrg# starting with Meson 0.55.0
867ec681f3Smrgif meson.has_exe_wrapper()
877ec681f3Smrg  test(
887ec681f3Smrg    'glsl compiler warnings',
897ec681f3Smrg    prog_python,
907ec681f3Smrg    args : [
917ec681f3Smrg      join_paths(meson.current_source_dir(), 'warnings_test.py'),
927ec681f3Smrg      '--glsl-compiler', glsl_compiler,
937ec681f3Smrg      '--test-directory', join_paths(
947ec681f3Smrg        meson.source_root(), 'src', 'compiler', 'glsl', 'tests', 'warnings'
957ec681f3Smrg      ),
967ec681f3Smrg    ],
977ec681f3Smrg    suite : ['compiler', 'glsl'],
987ec681f3Smrg    timeout: 60,
997ec681f3Smrg  )
1007ec681f3Smrg
1017ec681f3Smrg  test(
1027ec681f3Smrg    'glsl optimization',
1037ec681f3Smrg    prog_python,
1047ec681f3Smrg    args : [
1057ec681f3Smrg      join_paths(meson.current_source_dir(), 'optimization_test.py'),
1067ec681f3Smrg      '--test-runner', glsl_test
1077ec681f3Smrg    ],
1087ec681f3Smrg    suite : ['compiler', 'glsl'],
1097ec681f3Smrg  )
1107ec681f3Smrgendif
1117ec681f3Smrg
1127ec681f3Smrgif with_tools.contains('glsl')
1137ec681f3Smrg  test(
1147ec681f3Smrg    'glsl dump-builder test',
1157ec681f3Smrg    glsl_compiler,
1167ec681f3Smrg    args : ['--version', '110', '--dump-builder',
1177ec681f3Smrg            join_paths(meson.current_source_dir(), 'standalone_dump-builder.frag'),
1187ec681f3Smrg           ],
1197ec681f3Smrg    suite : ['compiler', 'glsl'],
1207ec681f3Smrg  )
1217ec681f3Smrg  test(
1227ec681f3Smrg    'glsl lower-precision test',
1237ec681f3Smrg    prog_python,
1247ec681f3Smrg    args : [join_paths(meson.current_source_dir(), 'lower_precision_test.py'),
1257ec681f3Smrg            glsl_compiler
1267ec681f3Smrg           ],
1277ec681f3Smrg    suite : ['compiler', 'glsl'],
1287ec681f3Smrg  )
1297ec681f3Smrgendif
130