2021-06-07 14:09:20 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								# Generate a compilation test for each SPA header, excluding the type-info.h
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# ones which have circular dependencies and take some effort to fix.
							 | 
						
					
						
							
								
									
										
										
										
											2021-06-08 11:19:33 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								# Do it for C++ if possible (picks up C++-specific errors), otherwise for C.
							 | 
						
					
						
							
								
									
										
										
										
											2021-06-07 14:09:20 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								find = find_program('find', required: false)
							 | 
						
					
						
							
								
									
										
										
										
											2021-06-29 11:17:03 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								summary({'find (for header testing)': find.found()}, bool_yn: true, section: 'Optional programs')
							 | 
						
					
						
							
								
									
										
										
										
											2021-06-07 14:09:20 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								if find.found()
							 | 
						
					
						
							
								
									
										
										
										
											2021-06-16 19:40:28 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  spa_headers = run_command(find,
							 | 
						
					
						
							
								
									
										
										
										
											2021-12-28 16:35:20 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                            meson.project_source_root() / 'spa' / 'include',
							 | 
						
					
						
							
								
									
										
										
										
											2021-06-07 14:09:20 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                            '-name', '*.h',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                            '-not', '-name', 'type-info.h',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                            '-type', 'f',
							 | 
						
					
						
							
								
									
										
										
										
											2022-01-17 08:15:03 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                            '-printf', '%P\n',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                            check: false)
							 | 
						
					
						
							
								
									
										
										
										
											2021-06-07 14:09:20 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  foreach spa_header : spa_headers.stdout().split('\n')
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    if spa_header.endswith('.h')  # skip empty lines
							 | 
						
					
						
							
								
									
										
										
										
											2021-06-16 19:40:28 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								      ext = have_cpp ? 'cpp' : 'c'
							 | 
						
					
						
							
								
									
										
										
										
											2021-06-07 14:09:20 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								      src = configure_file(input: 'spa-include-test-template.c',
							 | 
						
					
						
							
								
									
										
										
										
											2022-01-17 08:10:05 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                           output: 'spa-include-test-@0@.@1@'.format(spa_header.underscorify(), ext),
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                           configuration: {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                             'INCLUDE': spa_header,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                           })
							 | 
						
					
						
							
								
									
										
										
										
											2021-06-07 14:09:20 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								      executable('spa-include-test-@0@'.format(spa_header.underscorify()),
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                 src,
							 | 
						
					
						
							
								
									
										
										
										
											2021-12-28 16:04:06 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                 dependencies: [ spa_dep ],
							 | 
						
					
						
							
								
									
										
										
										
											2021-06-07 14:09:20 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                 install: false)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    endif
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  endforeach
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								endif
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-01-22 17:38:23 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								benchmark_apps = [
							 | 
						
					
						
							
								
									
										
										
										
											2021-09-30 10:01:43 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  'stress-ringbuffer',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  'benchmark-pod',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  'benchmark-dict',
							 | 
						
					
						
							
								
									
										
										
										
											2019-01-22 17:38:23 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								]
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								foreach a : benchmark_apps
							 | 
						
					
						
							
								
									
										
										
										
											2019-02-08 14:07:19 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  benchmark('spa-' + a,
							 | 
						
					
						
							
								
									
										
										
										
											2021-09-30 10:01:43 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    executable('spa-' + a, a + '.c',
							 | 
						
					
						
							
								
									
										
										
										
											2021-12-28 16:04:06 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								      dependencies : [ spa_dep, dl_lib, pthread_lib, mathlib ],
							 | 
						
					
						
							
								
									
										
										
										
											2021-09-30 10:01:43 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								      install : installed_tests_enabled,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      install_dir : installed_tests_execdir,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    ),
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    env : [
							 | 
						
					
						
							
								
									
										
										
										
											2022-01-17 08:23:55 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								      'SPA_PLUGIN_DIR=@0@'.format(spa_dep.get_variable('plugindir')),
							 | 
						
					
						
							
								
									
										
										
										
											2021-09-30 10:01:43 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    ]
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  )
							 | 
						
					
						
							
								
									
										
										
										
											2020-06-05 14:06:36 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  if installed_tests_enabled
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    test_conf = configuration_data()
							 | 
						
					
						
							
								
									
										
										
										
											2021-04-15 14:41:04 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    test_conf.set('exec', installed_tests_execdir / 'spa-' + a)
							 | 
						
					
						
							
								
									
										
										
										
											2020-06-05 14:06:36 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    configure_file(
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      input: installed_tests_template,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      output: 'spa-' + a + '.test',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      install_dir: installed_tests_metadir,
							 | 
						
					
						
							
								
									
										
										
										
											2021-09-30 10:01:43 +10:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								      configuration: test_conf,
							 | 
						
					
						
							
								
									
										
										
										
											2020-06-05 14:06:36 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    )
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  endif
							 | 
						
					
						
							
								
									
										
										
										
											2019-01-22 17:38:23 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								endforeach
							 |