1############################################################################# 2# 3# Copyright (C) 2019 Collabora Ltd 4# 5# Permission is hereby granted, free of charge, to any person obtaining a 6# copy of this software and associated documentation files (the "Software"), 7# to deal in the Software without restriction, including without limitation 8# the rights to use, copy, modify, merge, publish, distribute, sublicense, 9# and/or sell copies of the Software, and to permit persons to whom the 10# Software is furnished to do so, subject to the following conditions: 11# 12# The above copyright notice and this permission notice shall be included 13# in all copies or substantial portions of the Software. 14# 15# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 16# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 19# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 20# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 21# OTHER DEALINGS IN THE SOFTWARE. 22# 23 24check_dep = dependency('check') 25 26libvrtest_sources = [ 27 'testvirgl.c', 28 'testvirgl.h', 29 'testvirgl_encode.c', 30 'testvirgl_encode.h', 31] 32 33libvrtest = static_library( 34 'vrtest', 35 libvrtest_sources, 36 dependencies : [ 37 libvirgl_dep, 38 gallium_dep, 39 check_dep 40 ] 41) 42 43tests = [ 44 ['test_virgl_init', 'test_virgl_init.c'], 45 ['test_virgl_fence', 'test_virgl_fence.c'], 46 ['test_virgl_resource', 'test_virgl_resource.c'], 47 ['test_virgl_transfer', 'test_virgl_transfer.c'], 48 ['test_virgl_cmd', 'test_virgl_cmd.c'], 49 ['test_virgl_strbuf', 'test_virgl_strbuf.c'] 50] 51 52fuzzy_tests = [ 53 ['test_fuzzer_formats', 'test_fuzzer_formats.c'], 54] 55 56foreach t : tests 57 test_virgl = executable(t[0], t[1], link_with: libvrtest, 58 dependencies : [libvirglrenderer_dep, check_dep]) 59 test(t[0], test_virgl) 60endforeach 61 62foreach t : fuzzy_tests 63 test_virgl_fuzzy = executable(t[0], t[1], link_with: libvrtest, 64 dependencies : [libvirglrenderer_dep, epoxy_dep]) 65 test(t[0], test_virgl) 66endforeach 67 68 69if with_valgrind 70 valgrind = find_program('valgrind') 71 surpression_path = join_paths(meson.current_source_dir(), 'valgrind.suppressions') 72 args = ['--leak-check=full', '--quiet', '--error-exitcode=3', 73 '--suppressions='+ surpression_path] 74 foreach t : tests 75 test('valgrind-' + t[0], 76 valgrind, 77 args : args + [join_paths(meson.current_build_dir(), t[0])], 78 timeout : 1800) 79 endforeach 80endif 81 82if with_fuzzer 83 subdir('fuzzer') 84endif 85