build: Add a new "tests" option to disable building tests

This commit is contained in:
Yuri D'Elia 2023-11-02 11:42:56 +01:00
parent 5b29ad8b6d
commit f366125076
6 changed files with 271 additions and 254 deletions

View File

@ -94,6 +94,7 @@ list_maildirs = executable('list-maildirs', 'mu-scanner.cc',
# unit tests
#
if not get_option('tests').disabled()
test('test-threads',
executable('test-threads',
'mu-query-threads.cc',
@ -165,3 +166,4 @@ test('test-xapian-db',
subdir('tests')
endif

View File

@ -46,6 +46,7 @@ lib_mu_message_dep = declare_dependency(
# tests
#
if not get_option('tests').disabled()
test('test-contact',
executable('test-contact',
'mu-contact.cc',
@ -100,3 +101,4 @@ test('test-message-part',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, lib_mu_message_dep]))
endif

View File

@ -17,6 +17,8 @@
#
# tests
#
if not get_option('tests').disabled()
test('test-maildir',
executable('test-maildir',
'test-mu-maildir.cc',
@ -67,3 +69,4 @@ benchmark('bench-indexer', bench_indexer_exe, args: ['-m', 'perf'])
# valgrind/helgrind etc.
# test('test-bench-indexer', bench_indexer_exe,
# args : ['-m', 'quick'], env: ['THREADNUM=16'])
endif

View File

@ -57,6 +57,8 @@ html2text = executable('mu-html2text',
#
# tests
#
if not get_option('tests').disabled()
test('test-sexp',
executable('test-sexp', 'mu-sexp.cc',
install: false,
@ -113,3 +115,4 @@ test('test-error',
subdir('tests')
endif

View File

@ -15,6 +15,11 @@
## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
option('tests',
type: 'feature',
value: 'auto',
description: 'build tests')
option('guile',
type : 'feature',
value: 'auto',

View File

@ -42,6 +42,7 @@ mu = executable(
# tests
#
if not get_option('tests').disabled()
test('test-cmd-add',
executable('test-cmd-add',
'mu-cmd-add.cc',
@ -107,3 +108,4 @@ test('test-cmd-view',
dependencies: [glib_dep, lib_mu_dep]))
subdir('tests')
endif