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

@ -1,4 +1,4 @@
## Copyright (C) 2021-2023 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
## Copyright (C) 2021-2024 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
@ -18,6 +18,64 @@
################################################################################
# tests
#
# 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]))
test('test-mu-utils',
executable('test-mu-utils',
'test-utils.cc',