"Fossies" - the Fresh Open Source Software Archive

Member "wayland-1.18.0/tests/meson.build" (11 Feb 2020, 3642 Bytes) of package /linux/misc/wayland-1.18.0.tar.xz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 test_runner = static_library(
    2 	'test-runner',
    3 	sources: [
    4 		'test-runner.c',
    5 		'test-helpers.c',
    6 		'test-compositor.c'
    7 	],
    8 	include_directories: [ root_inc, src_inc ],
    9 	dependencies: [
   10 		cc.find_library('dl', required: false),
   11 		dependency('threads'),
   12 		ffi_dep,
   13 		wayland_util_dep,
   14 		wayland_private_dep,
   15 		wayland_client_dep,
   16 		wayland_server_dep
   17 	]
   18 )
   19 
   20 test_runner_dep = declare_dependency(
   21 	link_with: test_runner,
   22 	include_directories: [ src_inc ],
   23 	dependencies: [
   24 		dependency('threads'),
   25 		cc.find_library('dl', required: false)
   26 	]
   27 )
   28 
   29 tests_protocol_xml = files('../protocol/tests.xml')
   30 
   31 tests_server_protocol_h = custom_target(
   32 	'test server protocol header',
   33 	command: [ wayland_scanner_for_build, '-s', 'server-header', '@INPUT@', '@OUTPUT@' ],
   34 	input: tests_protocol_xml,
   35 	output: 'tests-server-protocol.h'
   36 )
   37 
   38 tests_client_protocol_c = custom_target(
   39 	'test client protocol header',
   40 	command: [ wayland_scanner_for_build, '-s', 'client-header', '@INPUT@', '@OUTPUT@' ],
   41 	input: tests_protocol_xml,
   42 	output: 'tests-client-protocol.h'
   43 )
   44 
   45 tests_protocol_c = custom_target(
   46 	'test protocol source',
   47 	command: [ wayland_scanner_for_build, '-s', 'public-code', '@INPUT@', '@OUTPUT@' ],
   48 	input: tests_protocol_xml,
   49 	output: 'tests-protocol.c'
   50 )
   51 
   52 benchmark(
   53 	'fixed-benchmark',
   54 	executable(
   55 		'fixed-benchmark',
   56 		'fixed-benchmark.c',
   57 		dependencies: test_runner_dep
   58 	)
   59 )
   60 
   61 executable(
   62 	'exec-fd-leak-checker',
   63 	'exec-fd-leak-checker.c',
   64 	dependencies: test_runner_dep
   65 )
   66 
   67 test(
   68 	'cpp-compile-test',
   69 	executable(
   70 		'cpp-compile-test',
   71 		'cpp-compile-test.cpp',
   72 		wayland_server_protocol_core_h,
   73 		include_directories: src_inc
   74 	)
   75 )
   76 
   77 sed_path = find_program('sed').path()
   78 
   79 test(
   80 	'scanner-test',
   81 	find_program('scanner-test.sh'),
   82 	env: [
   83 		'TEST_DATA_DIR=@0@/data'.format(meson.current_source_dir()),
   84 		'TEST_OUTPUT_DIR=@0@/output'.format(meson.current_build_dir()),
   85 		'SED=@0@'.format(sed_path),
   86 		'WAYLAND_SCANNER=@0@'.format(wayland_scanner.full_path()),
   87 	],
   88 )
   89 
   90 tests = {
   91 	'array-test': [],
   92 	'client-test': [ wayland_server_protocol_h ],
   93 	'display-test': [
   94 		tests_server_protocol_h,
   95 		tests_client_protocol_c,
   96 		tests_protocol_c,
   97 	],
   98 	'connection-test': [ wayland_server_protocol_h ],
   99 	'event-loop-test': [ wayland_server_protocol_h ],
  100 	'fixed-test': [],
  101 	'interface-test': [ wayland_client_protocol_h ],
  102 	'list-test': [],
  103 	'map-test': [],
  104 	'sanity-test' : [ wayland_server_protocol_h ],
  105 	'socket-test': [
  106 		wayland_client_protocol_h,
  107 		wayland_server_protocol_h,
  108 	],
  109 	'queue-test': [
  110 		wayland_client_protocol_h,
  111 		wayland_server_protocol_h,
  112 	],
  113 	'signal-test': [ wayland_server_protocol_h ],
  114 	'newsignal-test': [
  115 		# wayland-server.c is needed here to access wl_priv_* functions
  116 		files('../src/wayland-server.c'),
  117 		wayland_server_protocol_h,
  118 	],
  119 	'resources-test': [ wayland_server_protocol_core_h ],
  120 	'message-test': [
  121 		wayland_client_protocol_h,
  122 		wayland_server_protocol_h,
  123 	],
  124 	'compositor-introspection-test': [
  125 		wayland_client_protocol_h,
  126 		wayland_server_protocol_h,
  127 	],
  128 	'protocol-logger-test': [
  129 		wayland_server_protocol_core_h,
  130 		wayland_client_protocol_core_h,
  131 	],
  132 	'headers-test': [
  133 		'headers-protocol-test.c',
  134 		'headers-protocol-core-test.c',
  135 		wayland_server_protocol_core_h,
  136 		wayland_client_protocol_core_h,
  137 	],
  138 	'os-wrappers-test': [],
  139 }
  140 
  141 foreach test_name, test_extra_sources: tests
  142 	test_sources = [ test_name + '.c' ] + test_extra_sources
  143 	test_deps = [test_runner_dep]
  144 	bin = executable(test_name, test_sources, dependencies: test_deps)
  145 	test(
  146 		test_name,
  147 		bin,
  148 		env: [
  149 			'TEST_SRC_DIR=@0@'.format(meson.current_source_dir()),
  150 			'TEST_BUILD_DIR=@0@'.format(meson.current_build_dir()),
  151 		],
  152 	)
  153 endforeach