]> git.tdb.fi Git - ext/sigc++-2.0.git/blob - tests/meson.build
Adjust the name of the library to match upstream
[ext/sigc++-2.0.git] / tests / meson.build
1 # tests
2
3 # input: sigcxx_own_dep, do_benchmark, can_benchmark, benchmark_dep
4
5 benchmark_timeout = 100
6
7 test_programs = [
8 # [[dir-name], exe-name, [sources]]
9   [[], 'test_accum_iter', ['test_accum_iter.cc', 'testutilities.cc']],
10   [[], 'test_accumulated', ['test_accumulated.cc', 'testutilities.cc']],
11   [[], 'test_bind', ['test_bind.cc', 'testutilities.cc']],
12   [[], 'test_bind_as_slot', ['test_bind_as_slot.cc', 'testutilities.cc']],
13   [[], 'test_bind_ref', ['test_bind_ref.cc', 'testutilities.cc']],
14   [[], 'test_bind_refptr', ['test_bind_refptr.cc', 'testutilities.cc']],
15   [[], 'test_bind_return', ['test_bind_return.cc', 'testutilities.cc']],
16   [[], 'test_compose', ['test_compose.cc', 'testutilities.cc']],
17   [[], 'test_copy_invalid_slot', ['test_copy_invalid_slot.cc', 'testutilities.cc']],
18   [[], 'test_cpp11_lambda', ['test_cpp11_lambda.cc', 'testutilities.cc']],
19   [[], 'test_custom', ['test_custom.cc', 'testutilities.cc']],
20   [[], 'test_deduce_result_type', ['test_deduce_result_type.cc', 'testutilities.cc']],
21   [[], 'test_disconnect', ['test_disconnect.cc', 'testutilities.cc']],
22   [[], 'test_disconnect_during_emit', ['test_disconnect_during_emit.cc', 'testutilities.cc']],
23   [[], 'test_exception_catch', ['test_exception_catch.cc', 'testutilities.cc']],
24   [[], 'test_functor_trait', ['test_functor_trait.cc', 'testutilities.cc']],
25   [[], 'test_hide', ['test_hide.cc', 'testutilities.cc']],
26   [[], 'test_limit_reference', ['test_limit_reference.cc', 'testutilities.cc']],
27   [[], 'test_mem_fun', ['test_mem_fun.cc', 'testutilities.cc']],
28   [[], 'test_ptr_fun', ['test_ptr_fun.cc', 'testutilities.cc']],
29   [[], 'test_retype', ['test_retype.cc', 'testutilities.cc']],
30   [[], 'test_retype_return', ['test_retype_return.cc', 'testutilities.cc']],
31   [[], 'test_signal', ['test_signal.cc', 'testutilities.cc']],
32   [[], 'test_signal_move', ['test_signal_move.cc', 'testutilities.cc']],
33   [[], 'test_size', ['test_size.cc', 'testutilities.cc']],
34   [[], 'test_slot', ['test_slot.cc', 'testutilities.cc']],
35   [[], 'test_slot_disconnect', ['test_slot_disconnect.cc', 'testutilities.cc']],
36   [[], 'test_slot_move', ['test_slot_move.cc', 'testutilities.cc']],
37   [[], 'test_trackable', ['test_trackable.cc', 'testutilities.cc']],
38   [[], 'test_trackable_move', ['test_trackable_move.cc', 'testutilities.cc']],
39   [[], 'test_track_obj', ['test_track_obj.cc', 'testutilities.cc']],
40   [[], 'test_visit_each', ['test_visit_each.cc', 'testutilities.cc']],
41 ]
42
43 benchmark_programs = [
44 # [[dir-name], exe-name, [sources]]
45   [[], 'benchmark1', ['benchmark.cc']],
46 ]
47
48 foreach ex : test_programs
49   dir = ''
50   foreach dir_part : ex[0]
51     dir = dir / dir_part
52   endforeach
53   ex_name = (dir / ex[1]).underscorify()
54   ex_sources = []
55   foreach src : ex[2]
56     ex_sources += dir / src
57   endforeach
58
59   exe_file = executable(ex_name, ex_sources,
60     dependencies: sigcxx_own_dep,
61     implicit_include_directories: false,
62     build_by_default: true
63   )
64
65   test(ex_name, exe_file)
66 endforeach
67
68 if can_benchmark
69   foreach ex : benchmark_programs
70     dir = ''
71     foreach dir_part : ex[0]
72       dir = dir / dir_part
73     endforeach
74     ex_name = (dir / ex[1]).underscorify()
75     ex_sources = []
76     foreach src : ex[2]
77       ex_sources += dir / src
78     endforeach
79
80     exe_file = executable(ex_name, ex_sources,
81       dependencies: [sigcxx_own_dep, benchmark_dep],
82       implicit_include_directories: false,
83       build_by_default: do_benchmark
84     )
85
86     if do_benchmark
87       test(ex_name, exe_file,
88         timeout: benchmark_timeout,
89       )
90     endif
91   endforeach
92 endif