tests: only build when needed

Build the tests lazily, i.e., not before `meson test`. This helps with
build-times.
This commit is contained in:
Dirk-Jan C. Binnema
2025-08-15 21:01:05 +03:00
parent 0714873978
commit 34d3bf2e28
6 changed files with 53 additions and 6 deletions

View File

@ -1,4 +1,4 @@
## Copyright (C) 2021-2024 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
## Copyright (C) 2021-2025 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
@ -25,54 +25,63 @@
test('test-sexp',
executable('test-sexp', '../mu-sexp.cc',
install: false,
build_by_default: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, lib_mu_utils_dep]))
test('test-regex',
executable('test-regex', '../mu-regex.cc',
install: false,
build_by_default: 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,
build_by_default: 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,
build_by_default: 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,
build_by_default: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, lib_mu_utils_dep,config_h_dep,thread_dep ]))
test('test-option',
executable('test-option', '../mu-option.cc',
install: false,
build_by_default: 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,
build_by_default: 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,
build_by_default: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, lib_mu_utils_dep]))
test('test-error',
executable('test-error', '../mu-error.cc',
install: false,
build_by_default: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, lib_mu_utils_dep]))
@ -80,4 +89,5 @@ test('test-mu-utils',
executable('test-mu-utils',
'test-utils.cc',
install: false,
build_by_default: false,
dependencies: [glib_dep, lib_mu_utils_dep]))