]> begriffs open source - libderp/blob - test/meson.build
WIP: begriffs style .so installation
[libderp] / test / meson.build
1 fs = import('fs')
2
3 test_env = []
4 if get_option('b_sanitize').contains('address')
5   test_env += 'ASAN_OPTIONS=detect_leaks=1:abort_on_error=1:print_stats=1'
6 endif
7 if get_option('b_sanitize').contains('undefined')
8   test_env += 'UBSAN_OPTIONS=print_stacktrace=1:abort_on_error=1'
9 endif
10
11 test_sources = [
12   't_vector.c',
13   't_list.c',
14   't_hashmap.c',
15   't_treemap.c',
16 ]
17
18 foreach test_source : test_sources
19   test_name = fs.replace_suffix(test_source, '')
20   test_exe = executable(test_name,
21     test_source,
22     dependencies : libderp_dep,
23     c_args : get_option('b_sanitize').contains('address')
24       ? [] : ['-DTEST_HUGE_ALLOCATION_FAILURE=1'],
25     install : false)
26
27   test(test_name, test_exe, 
28     suite : 'libderp',
29     env : test_env)
30 endforeach