tests: move to tests/, make optional

While not recommended, sometimes it can be useful to disable building
the unit tests. This can be done now with
    meson -Dtests=disabled build
This commit is contained in:
Dirk-Jan C. Binnema
2024-01-06 18:35:22 +02:00
parent 8db0c4e3d8
commit 30b8238522
11 changed files with 350 additions and 300 deletions

View File

@ -54,62 +54,6 @@ html2text = executable('mu-html2text',
cpp_args: ['-DBUILD_HTML_TO_TEXT'],
install: false)
#
# tests
#
test('test-sexp',
executable('test-sexp', 'mu-sexp.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, lib_mu_utils_dep]))
test('test-regex',
executable('test-regex', 'mu-regex.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, lib_mu_utils_dep]))
test('test-command-handler',
executable('test-command-handler', 'mu-command-handler.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, lib_mu_utils_dep]))
test('test-utils-file',
executable('test-utils-file', 'mu-utils-file.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, gio_unix_dep,config_h_dep, lib_mu_utils_dep]))
test('test-logger',
executable('test-logger', 'mu-logger.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, lib_mu_utils_dep, thread_dep ]))
test('test-option',
executable('test-option', 'mu-option.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, lib_mu_utils_dep ]))
test('test-lang-detector',
executable('test-lang-detector', 'mu-lang-detector.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [ config_h_dep, glib_dep, lib_mu_utils_dep ]))
test('test-html-to-text',
executable('test-html-to-text', 'mu-html-to-text.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, lib_mu_utils_dep]))
test('test-error',
executable('test-error', 'mu-error.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, lib_mu_utils_dep]))
subdir('tests')
if not get_option('tests').disabled()
subdir('tests')
endif