| 1 |
unit_tests = [ |
| 2 |
'test-checker', |
| 3 |
'test-entry', |
| 4 |
'test-icu', |
| 5 |
'test-inline-checker-text-buffer', |
| 6 |
'test-text-iter', |
| 7 |
'test-utils', |
| 8 |
] |
| 9 |
|
| 10 |
unit_tests_install_dir = join_paths( |
| 11 |
get_option('prefix'), |
| 12 |
get_option('libexecdir'), |
| 13 |
'installed-tests', |
| 14 |
'@0@-@1@'.format(meson.project_name(), GSPELL_API_VERSION) |
| 15 |
) |
| 16 |
|
| 17 |
foreach test_name : unit_tests |
| 18 |
test_exe = executable( |
| 19 |
test_name, |
| 20 |
test_name + '.c', |
| 21 |
dependencies: GSPELL_STATIC_DEP, |
| 22 |
install: get_option('install_tests'), |
| 23 |
install_dir: unit_tests_install_dir, |
| 24 |
) |
| 25 |
test(test_name, test_exe) |
| 26 |
|
| 27 |
if get_option('install_tests') |
| 28 |
unit_test_config_data = configuration_data() |
| 29 |
unit_test_config_data.set('TEST_NAME', test_name) |
| 30 |
unit_test_config_data.set('UNIT_TESTS_INSTALL_DIR', unit_tests_install_dir) |
| 31 |
|
| 32 |
configure_file( |
| 33 |
input: 'gspell.test.in', |
| 34 |
output: '@[email protected]'.format(test_name), |
| 35 |
configuration: unit_test_config_data, |
| 36 |
install: true, |
| 37 |
install_dir: join_paths( |
| 38 |
get_option('datadir'), |
| 39 |
'installed-tests', |
| 40 |
'@0@-@1@'.format(meson.project_name(), GSPELL_API_VERSION) |
| 41 |
), |
| 42 |
) |
| 43 |
endif |
| 44 |
endforeach |