From 4ccb9816737945159289527322e759d92bf7a4d6 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Mon, 11 Dec 2017 16:13:31 -0800 Subject: [PATCH] meson: Use consistent style for tests Don't use intermediate variables, use consistent whitespace. Acked-by: Eric Engestrom Signed-off-by: Dylan Baker --- src/broadcom/qpu/meson.build | 12 ++-- src/compiler/glsl/tests/meson.build | 90 ++++++++++++++++------------- src/compiler/nir/meson.build | 19 +++--- src/egl/wayland/wayland-egl/meson.build | 5 +- src/gallium/drivers/llvmpipe/meson.build | 4 +- src/gallium/drivers/r300/meson.build | 4 +- src/gallium/state_trackers/xvmc/meson.build | 8 ++- src/gbm/meson.build | 3 +- src/glx/tests/meson.build | 22 +++---- src/intel/compiler/meson.build | 19 +++--- src/intel/isl/meson.build | 17 +++--- src/intel/vulkan/meson.build | 23 ++++---- src/mapi/es1api/meson.build | 3 +- src/mapi/es2api/meson.build | 3 +- src/mapi/glapi/meson.build | 13 +++-- src/mapi/shared-glapi/meson.build | 19 +++--- src/mesa/main/tests/meson.build | 4 +- src/util/meson.build | 49 +++++++++------- src/util/tests/hash_table/meson.build | 16 ++--- src/util/tests/string_buffer/meson.build | 17 +++--- 20 files changed, 199 insertions(+), 151 deletions(-) diff --git a/src/broadcom/qpu/meson.build b/src/broadcom/qpu/meson.build index 8178ddb..5521a80 100644 --- a/src/broadcom/qpu/meson.build +++ b/src/broadcom/qpu/meson.build @@ -33,7 +33,11 @@ libbroadcom_qpu = static_library( build_by_default : false, ) -test('qpu_disasm', - executable('qpu_disasm', 'tests/qpu_disasm.c', - link_with: [libbroadcom_qpu, libmesa_util], - include_directories: inc_common)) +test( + 'qpu_disasm', + executable( + 'qpu_disasm', 'tests/qpu_disasm.c', + link_with: [libbroadcom_qpu, libmesa_util], + include_directories: inc_common + ) +) diff --git a/src/compiler/glsl/tests/meson.build b/src/compiler/glsl/tests/meson.build index 27f3407..146647a 100644 --- a/src/compiler/glsl/tests/meson.build +++ b/src/compiler/glsl/tests/meson.build @@ -18,59 +18,69 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -glsl_blob_test = executable( +test( 'blob_test', - 'blob_test.c', - c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args], - include_directories : [inc_common, inc_compiler], - link_with : [libglsl], + executable( + 'blob_test', + 'blob_test.c', + c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args], + include_directories : [inc_common, inc_compiler], + link_with : [libglsl], + ) ) -glsl_cache_test = executable( +test( 'cache_test', - 'cache_test.c', - c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args], - include_directories : [inc_common, inc_glsl], - link_with : [libglsl], - dependencies : [dep_clock, dep_thread], + executable( + 'cache_test', + 'cache_test.c', + c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args], + include_directories : [inc_common, inc_glsl], + link_with : [libglsl], + dependencies : [dep_clock, dep_thread], + ) ) -glsl_general_ir_test = executable( + +test( 'general_ir_test', - ['array_refcount_test.cpp', 'builtin_variable_test.cpp', - 'invalidate_locations_test.cpp', 'general_ir_test.cpp', - 'lower_int64_test.cpp', 'opt_add_neg_to_sub_test.cpp', 'varyings_test.cpp', - ir_expression_operation_h], - cpp_args : [cpp_vis_args, cpp_msvc_compat_args], - include_directories : [inc_common, inc_glsl], - link_with : [libglsl, libglsl_standalone, libglsl_util], - dependencies : [dep_clock, dep_thread, idep_gtest], + executable( + 'general_ir_test', + ['array_refcount_test.cpp', 'builtin_variable_test.cpp', + 'invalidate_locations_test.cpp', 'general_ir_test.cpp', + 'lower_int64_test.cpp', 'opt_add_neg_to_sub_test.cpp', + 'varyings_test.cpp', ir_expression_operation_h], + cpp_args : [cpp_vis_args, cpp_msvc_compat_args], + include_directories : [inc_common, inc_glsl], + link_with : [libglsl, libglsl_standalone, libglsl_util], + dependencies : [dep_clock, dep_thread, idep_gtest], + ) ) -glsl_uniform_initializer_test = executable( +test( 'uniform_initializer_test', - ['copy_constant_to_storage_tests.cpp', 'set_uniform_initializer_tests.cpp', - 'uniform_initializer_utils.cpp', 'uniform_initializer_utils.h', - ir_expression_operation_h], - cpp_args : [cpp_vis_args, cpp_msvc_compat_args], - include_directories : [inc_common, inc_glsl], - link_with : [libglsl, libglsl_util], - dependencies : [dep_thread, idep_gtest], + executable( + 'uniform_initializer_test', + ['copy_constant_to_storage_tests.cpp', 'set_uniform_initializer_tests.cpp', + 'uniform_initializer_utils.cpp', 'uniform_initializer_utils.h', + ir_expression_operation_h], + cpp_args : [cpp_vis_args, cpp_msvc_compat_args], + include_directories : [inc_common, inc_glsl], + link_with : [libglsl, libglsl_util], + dependencies : [dep_thread, idep_gtest], + ) ) -glsl_sampler_types_test = executable( +test( 'sampler_types_test', - ['sampler_types_test.cpp', ir_expression_operation_h], - cpp_args : [cpp_vis_args, cpp_msvc_compat_args], - include_directories : [inc_common, inc_glsl], - link_with : [libglsl, libglsl_util], - dependencies : [dep_thread, idep_gtest], + executable( + 'sampler_types_test', + ['sampler_types_test.cpp', ir_expression_operation_h], + cpp_args : [cpp_vis_args, cpp_msvc_compat_args], + include_directories : [inc_common, inc_glsl], + link_with : [libglsl, libglsl_util], + dependencies : [dep_thread, idep_gtest], + ) ) -test('blob_test', glsl_blob_test) -test('cache_test', glsl_cache_test) -test('general_ir_test', glsl_general_ir_test) -test('uniform_initializer_test', glsl_uniform_initializer_test) -test('sampler_types_test', glsl_sampler_types_test) - # TODO: figure out how to get the shell based tests to work? diff --git a/src/compiler/nir/meson.build b/src/compiler/nir/meson.build index 5dd21e6..54cef67 100644 --- a/src/compiler/nir/meson.build +++ b/src/compiler/nir/meson.build @@ -208,14 +208,15 @@ libnir = static_library( nir_algebraic_py = files('nir_algebraic.py') if with_tests - nir_control_flow_test = executable( - 'nir_control_flow_test', - [files('tests/control_flow_tests.cpp'), nir_opcodes_h], - c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args], - include_directories : [inc_common], - dependencies : [dep_thread, idep_gtest], - link_with : [libmesa_util, libnir], + test( + 'nir_control_flow', + executable( + 'nir_control_flow_test', + [files('tests/control_flow_tests.cpp'), nir_opcodes_h], + c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args], + include_directories : [inc_common], + dependencies : [dep_thread, idep_gtest], + link_with : [libmesa_util, libnir], + ) ) - - test('nir_control_flow', nir_control_flow_test) endif diff --git a/src/egl/wayland/wayland-egl/meson.build b/src/egl/wayland/wayland-egl/meson.build index 14c78a3..c95d4c1 100644 --- a/src/egl/wayland/wayland-egl/meson.build +++ b/src/egl/wayland/wayland-egl/meson.build @@ -42,5 +42,8 @@ if with_tests find_program('wayland-egl-symbols-check'), args : libwayland_egl ) - test('wayland-egl-abi-check', executable('wayland-egl-abi-check', 'wayland-egl-abi-check.c')) + test( + 'wayland-egl-abi-check', + executable('wayland-egl-abi-check', 'wayland-egl-abi-check.c') + ) endif diff --git a/src/gallium/drivers/llvmpipe/meson.build b/src/gallium/drivers/llvmpipe/meson.build index 597245e..0b0ac2a 100644 --- a/src/gallium/drivers/llvmpipe/meson.build +++ b/src/gallium/drivers/llvmpipe/meson.build @@ -111,7 +111,9 @@ driver_swrast = declare_dependency( if with_tests and with_gallium_softpipe and with_llvm foreach t : ['lp_test_format', 'lp_test_arit', 'lp_test_blend', 'lp_test_conv', 'lp_test_printf'] - test(t, executable( + test( + t, + executable( t, ['@0@.c'.format(t), 'lp_test_main.c'], dependencies : [dep_llvm, dep_dl, dep_thread, dep_clock], diff --git a/src/gallium/drivers/r300/meson.build b/src/gallium/drivers/r300/meson.build index 90fa594..698e460 100644 --- a/src/gallium/drivers/r300/meson.build +++ b/src/gallium/drivers/r300/meson.build @@ -135,7 +135,9 @@ driver_r300 = declare_dependency( ) if with_tests - test('r300_compiler_test', executable( + test( + 'r300_compiler_test', + executable( 'r300_compiler_test', files( 'compiler/tests/r300_compiler_tests.c', diff --git a/src/gallium/state_trackers/xvmc/meson.build b/src/gallium/state_trackers/xvmc/meson.build index a1022c1..2c98b02 100644 --- a/src/gallium/state_trackers/xvmc/meson.build +++ b/src/gallium/state_trackers/xvmc/meson.build @@ -32,7 +32,9 @@ if with_tests dep_real_xvmc = dependency('xvmc') foreach x : ['context', 'surface', 'subpicture', 'blocks', 'rendering'] _name = 'xvmc_@0@'.format(x) - test(_name, executable( + test( + _name, + executable( _name, files('tests/test_@0@.c'.format(x), 'tests/testlib.c'), dependencies : [ @@ -42,7 +44,9 @@ if with_tests ) endforeach - test('xbmc_bench', executable( + test( + 'xvmc_bench', + executable( 'xvmc_bench', files('tests/xvmc_bench.c', 'tests/testlib.c'), dependencies : [ diff --git a/src/gbm/meson.build b/src/gbm/meson.build index 6e51299..14b9e96 100644 --- a/src/gbm/meson.build +++ b/src/gbm/meson.build @@ -71,7 +71,8 @@ pkg.generate( ) if with_tests - test('gbm-symbols-check', + test( + 'gbm-symbols-check', find_program('gbm-symbols-check'), args : libgbm ) diff --git a/src/glx/tests/meson.build b/src/glx/tests/meson.build index 51b2843..fe0075a 100644 --- a/src/glx/tests/meson.build +++ b/src/glx/tests/meson.build @@ -33,17 +33,17 @@ if with_shared_glapi files_glx_test += files('query_renderer_implementation_unittest.cpp') endif - glx_test = executable( + test( 'glx-test', - [files_glx_test, glx_indirect_size_h, main_dispatch_h], - link_with : [libglx, libglapi], - include_directories : [ - include_directories('..', '../../../include/GL/internal'), - inc_src, inc_include, inc_mesa, inc_mapi, - ], - dependencies : [dep_libdrm, dep_thread, idep_gtest] + executable( + 'glx-test', + [files_glx_test, glx_indirect_size_h, main_dispatch_h], + link_with : [libglx, libglapi], + include_directories : [ + include_directories('..', '../../../include/GL/internal'), + inc_src, inc_include, inc_mesa, inc_mapi, + ], + dependencies : [dep_libdrm, dep_thread, idep_gtest] + ) ) - - test('glx-test', glx_test) - test('glx-dispatch-index-check', find_program('dispatch-index-check')) endif diff --git a/src/intel/compiler/meson.build b/src/intel/compiler/meson.build index c54c117..19e5926 100644 --- a/src/intel/compiler/meson.build +++ b/src/intel/compiler/meson.build @@ -145,14 +145,17 @@ if with_tests 'fs_saturate_propagation', 'vf_float_conversions', 'vec4_register_coalesce', 'vec4_copy_propagation', 'vec4_cmod_propagation', 'eu_compact', 'eu_validate'] - _exe = executable( - [t, nir_opcodes_h, ir_expression_operation_h], - 'test_@0@.cpp'.format(t), - include_directories : [inc_common, inc_intel], - link_with : [libintel_compiler, libintel_common, libnir, libmesa_util, - libisl], - dependencies : [dep_thread, dep_dl, idep_gtest], + test( + t, + executable( + [t, nir_opcodes_h, ir_expression_operation_h], + 'test_@0@.cpp'.format(t), + include_directories : [inc_common, inc_intel], + link_with : [ + libintel_compiler, libintel_common, libnir, libmesa_util, libisl, + ], + dependencies : [dep_thread, dep_dl, idep_gtest], + ) ) - test(t, _exe) endforeach endif diff --git a/src/intel/isl/meson.build b/src/intel/isl/meson.build index 47fd8d9..116750d 100644 --- a/src/intel/isl/meson.build +++ b/src/intel/isl/meson.build @@ -90,13 +90,14 @@ libisl = static_library( ) if with_tests - isl_surf_get_image_offset_test = executable( - 'isl_surf_get_image_offset_test', - 'tests/isl_surf_get_image_offset_test.c', - dependencies : dep_m, - include_directories : [inc_common, inc_intel], - link_with : [libisl, libintel_common], + test( + 'isl_surf_get_image_offset', + executable( + 'isl_surf_get_image_offset_test', + 'tests/isl_surf_get_image_offset_test.c', + dependencies : dep_m, + include_directories : [inc_common, inc_intel], + link_with : [libisl, libintel_common], + ) ) - - test('isl_surf_get_image_offset', isl_surf_get_image_offset_test) endif diff --git a/src/intel/vulkan/meson.build b/src/intel/vulkan/meson.build index b219201..66266a0 100644 --- a/src/intel/vulkan/meson.build +++ b/src/intel/vulkan/meson.build @@ -193,25 +193,28 @@ if with_tests link_whole : libanv_common, link_with : [ libanv_gen_libs, libintel_compiler, libintel_common, libisl, libblorp, - libvulkan_util, libvulkan_wsi, libnir, libmesa_util, + libvulkan_util, libvulkan_wsi, libmesa_util, ], dependencies : [ dep_libdrm, dep_thread, dep_dl, dep_m, anv_deps, dep_valgrind, + idep_nir, ], c_args : [c_vis_args, no_override_init_args, '-msse2', anv_flags], ) foreach t : ['block_pool_no_free', 'state_pool_no_free', 'state_pool_free_list_only', 'state_pool'] - _exe = executable( - t, - ['tests/@0@.c'.format(t), dummy_cpp, block_entrypoints], - link_with : libvulkan_intel_test, - dependencies : [dep_libdrm, dep_thread, dep_m, dep_valgrind], - include_directories : [ - inc_common, inc_intel, inc_compiler, inc_vulkan_util, inc_vulkan_wsi, - ], + test( + 'anv_@0@'.format(t), + executable( + t, + ['tests/@0@.c'.format(t), dummy_cpp, block_entrypoints], + link_with : libvulkan_intel_test, + dependencies : [dep_libdrm, dep_thread, dep_m, dep_valgrind], + include_directories : [ + inc_common, inc_intel, inc_compiler, inc_vulkan_util, inc_vulkan_wsi, + ], + ) ) - test('anv_@0@'.format(t), _exe) endforeach endif diff --git a/src/mapi/es1api/meson.build b/src/mapi/es1api/meson.build index 53851da..ea14654 100644 --- a/src/mapi/es1api/meson.build +++ b/src/mapi/es1api/meson.build @@ -52,7 +52,8 @@ pkg.generate( ) if with_tests - test('es1-ABI-check', + test( + 'es1-ABI-check', find_program('ABI-check'), args : libglesv1_cm ) diff --git a/src/mapi/es2api/meson.build b/src/mapi/es2api/meson.build index 8751107..de8a29b 100644 --- a/src/mapi/es2api/meson.build +++ b/src/mapi/es2api/meson.build @@ -52,7 +52,8 @@ pkg.generate( ) if with_tests - test('es2-ABI-check', + test( + 'es2-ABI-check', find_program('ABI-check'), args : libgles2 ) diff --git a/src/mapi/glapi/meson.build b/src/mapi/glapi/meson.build index 8856a95..267cfe7 100644 --- a/src/mapi/glapi/meson.build +++ b/src/mapi/glapi/meson.build @@ -78,12 +78,13 @@ libglapi_static = static_library( ) if not with_shared_glapi and with_tests - glapi_static_check_table = executable( + test( 'glapi_static_check_table', - 'tests/check_table.cpp', - link_with : [libglapi_static], - dependencies : [idep_gtest], + executable( + 'glapi_static_check_table', + 'tests/check_table.cpp', + link_with : [libglapi_static], + dependencies : [idep_gtest], + ) ) - - test('glapi_static_check_table', glapi_static_check_table) endif diff --git a/src/mapi/shared-glapi/meson.build b/src/mapi/shared-glapi/meson.build index fe0d458..c7d136c 100644 --- a/src/mapi/shared-glapi/meson.build +++ b/src/mapi/shared-glapi/meson.build @@ -51,14 +51,15 @@ libglapi = shared_library( ) if with_tests - shared_glapi_test = executable( - ['shared-glapi-test', glapitable_h], - 'tests/check_table.cpp', - cpp_args : [cpp_msvc_compat_args], - include_directories : [inc_src, inc_include, inc_mapi], - link_with : [libglapi], - dependencies : [dep_thread, idep_gtest], + test( + 'shared-glapi-test', + executable( + ['shared-glapi-test', glapitable_h], + 'tests/check_table.cpp', + cpp_args : [cpp_msvc_compat_args], + include_directories : [inc_src, inc_include, inc_mapi], + link_with : [libglapi], + dependencies : [dep_thread, idep_gtest], + ) ) - - test('shared-glapi-test', shared_glapi_test) endif diff --git a/src/mesa/main/tests/meson.build b/src/mesa/main/tests/meson.build index 2c1d8e0..12be739 100644 --- a/src/mesa/main/tests/meson.build +++ b/src/mesa/main/tests/meson.build @@ -33,7 +33,9 @@ else files_main_test += files('stub.cpp') endif -test('main-test', executable( +test( + 'main-test', + executable( 'main_test', [files_main_test, main_dispatch_h], include_directories : [inc_include, inc_src, inc_mapi, inc_mesa], diff --git a/src/util/meson.build b/src/util/meson.build index 225593f..fa591c9 100644 --- a/src/util/meson.build +++ b/src/util/meson.build @@ -118,34 +118,39 @@ libxmlconfig = static_library( ) if with_tests - u_atomic_test = executable( - 'u_atomic_test', - files('u_atomic_test.c'), - include_directories : inc_common, - link_with : libmesa_util, - c_args : [c_msvc_compat_args], + test( + 'u_atomic', + executable( + 'u_atomic_test', + files('u_atomic_test.c'), + include_directories : inc_common, + link_with : libmesa_util, + c_args : [c_msvc_compat_args], + ) ) - roundeven_test = executable( - 'roundeven_test', - files('roundeven_test.c'), - include_directories : inc_common, - c_args : [c_msvc_compat_args], - dependencies : [dep_m], + test( + 'roundeven', + executable( + 'roundeven_test', + files('roundeven_test.c'), + include_directories : inc_common, + c_args : [c_msvc_compat_args], + dependencies : [dep_m], + ) ) - mesa_sha1_test = executable( - 'mesa-sha1_test', - files('mesa-sha1_test.c'), - include_directories : inc_common, - link_with : libmesa_util, - c_args : [c_msvc_compat_args], + test( + 'mesa-sha1', + executable( + 'mesa-sha1_test', + files('mesa-sha1_test.c'), + include_directories : inc_common, + link_with : libmesa_util, + c_args : [c_msvc_compat_args], + ) ) - test('u_atomic', u_atomic_test) - test('roundeven', roundeven_test) - test('mesa-sha1', mesa_sha1_test) - subdir('tests/hash_table') subdir('tests/string_buffer') endif diff --git a/src/util/tests/hash_table/meson.build b/src/util/tests/hash_table/meson.build index 43d8f43..4bbc510 100644 --- a/src/util/tests/hash_table/meson.build +++ b/src/util/tests/hash_table/meson.build @@ -21,12 +21,14 @@ foreach t : ['clear', 'collision', 'delete_and_lookup', 'delete_management', 'destroy_callback', 'insert_and_lookup', 'insert_many', 'null_destroy', 'random_entry', 'remove_null', 'replacement'] - _test = executable( - '@0@_test'.format(t), - files('@0@.c'.format(t)), - dependencies : [dep_thread, dep_dl], - include_directories : [inc_include, inc_util], - link_with : libmesa_util, + test( + t, + executable( + '@0@_test'.format(t), + files('@0@.c'.format(t)), + dependencies : [dep_thread, dep_dl], + include_directories : [inc_include, inc_util], + link_with : libmesa_util, + ) ) - test(t, _test) endforeach diff --git a/src/util/tests/string_buffer/meson.build b/src/util/tests/string_buffer/meson.build index 14dbebc..9f42e35 100644 --- a/src/util/tests/string_buffer/meson.build +++ b/src/util/tests/string_buffer/meson.build @@ -18,12 +18,13 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -string_buffer_test = executable( - 'string_buffer_test', - 'string_buffer_test.cpp', - dependencies : [dep_thread, dep_dl, idep_gtest], - include_directories : inc_common, - link_with : [libmesa_util], +test( + 'string_buffer', + executable( + 'string_buffer_test', + 'string_buffer_test.cpp', + dependencies : [dep_thread, dep_dl, idep_gtest], + include_directories : inc_common, + link_with : [libmesa_util], + ) ) - -test('string_buffer', string_buffer_test) -- 2.7.4