2018-10-27 21:47:04 +00:00
|
|
|
test_runner_exe = executable('test_runner',
|
|
|
|
['test_runner.cc'],
|
|
|
|
dependencies: libostd,
|
|
|
|
include_directories: libostd_includes,
|
2018-10-27 22:53:58 +00:00
|
|
|
cpp_args: extra_cxxflags,
|
2018-10-27 21:47:04 +00:00
|
|
|
install: false
|
|
|
|
)
|
|
|
|
|
2018-10-28 00:47:54 +00:00
|
|
|
libostd_gen_test_exe = executable('gen_test',
|
|
|
|
['gen_test.cc'],
|
|
|
|
install: false,
|
|
|
|
native: true
|
|
|
|
)
|
|
|
|
|
|
|
|
libostd_tests_names = [
|
|
|
|
'algorithm',
|
|
|
|
'range'
|
|
|
|
]
|
|
|
|
|
|
|
|
libostd_tests_indices = [
|
|
|
|
0, 1
|
2018-10-27 21:47:04 +00:00
|
|
|
]
|
|
|
|
|
2018-10-28 00:47:54 +00:00
|
|
|
libostd_tests_src = []
|
|
|
|
|
|
|
|
foreach test_name: libostd_tests_names
|
|
|
|
libostd_tests_src += custom_target('test_' + test_name,
|
2018-12-02 02:32:38 +00:00
|
|
|
output: ['test_' + test_name + '.cc'],
|
2018-10-28 00:47:54 +00:00
|
|
|
install: false,
|
|
|
|
command: [
|
|
|
|
libostd_gen_test_exe, test_name,
|
2018-12-02 02:32:38 +00:00
|
|
|
join_paths(meson.current_build_dir(), 'test_' + test_name + '.cc')
|
2018-10-28 00:47:54 +00:00
|
|
|
]
|
|
|
|
)
|
|
|
|
endforeach
|
|
|
|
|
2018-10-27 21:47:04 +00:00
|
|
|
test_target = []
|
2018-10-28 00:47:54 +00:00
|
|
|
foreach test_idx: libostd_tests_indices
|
2018-12-02 02:32:38 +00:00
|
|
|
test_target += executable('test_' + libostd_tests_names[test_idx],
|
2018-10-28 00:47:54 +00:00
|
|
|
[libostd_tests_src[test_idx]],
|
2018-10-27 21:47:04 +00:00
|
|
|
dependencies: libostd,
|
|
|
|
include_directories: libostd_includes,
|
2018-10-27 22:53:58 +00:00
|
|
|
cpp_args: extra_cxxflags,
|
2018-10-27 21:47:04 +00:00
|
|
|
install: false
|
|
|
|
)
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
test('libostd',
|
|
|
|
test_runner_exe,
|
|
|
|
args: [meson.current_build_dir()],
|
|
|
|
workdir: meson.current_build_dir(),
|
|
|
|
depends: test_target
|
|
|
|
)
|