aboutsummaryrefslogtreecommitdiff
path: root/meson.build
blob: 03040c2017460eeecddd773acd361b308c78f66d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
project('lfrtm', 'c', default_options : [
	'buildtype=release',
	'warning_level=3',
	'werror=true',
	'b_lto=false',
	'c_std=c11'])

version = run_command('cat', 'VERSION').stdout().strip()

add_project_arguments('-D_GNU_SOURCE', language : 'c')

conf_data = configuration_data()
cc = meson.get_compiler('c')

thread_dep = dependency('threads')
deps = [thread_dep]

c_args = []

if host_machine.system() == 'darwin'
	c_args += '-Wno-deprecated-declarations' # shm_init/destroy
endif

dummy_calloc = shared_library('dummy_calloc',
	join_paths('test', 'dummy_calloc.c'),
	c_args : c_args,
	dependencies : deps,
	install : false)

lfrtm_test = executable('lfrtm_test',
	join_paths('test', 'lfrtm_test.c'),
	c_args : c_args,
	dependencies : deps,
	install : false)

test(' 1 threads', lfrtm_test,
	args : ['1'],
	timeout : 240)
test(' 2 threads', lfrtm_test,
	args : ['1'],
	timeout : 240)
test(' 4 threads', lfrtm_test,
	args : ['1'],
	timeout : 240)
test(' 8 threads', lfrtm_test,
	args : ['1'],
	timeout : 240)
if host_machine.system() == 'linux'
	test('16 threads', lfrtm_test,
		args : ['1'],
		timeout : 240)
	test('32 threads', lfrtm_test,
		args : ['1'],
		timeout : 240)
endif
#test('dummy alloc', lfrtm_test,
#	args : ['2', '1'],
#	timeout : 240,
#	env : ['LD_PRELOAD='+dummy_calloc.full_path()])