Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
144 changes: 73 additions & 71 deletions lib/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -94,74 +94,76 @@ list_maildirs = executable('list-maildirs', 'mu-scanner.cc',
# unit tests
#

test('test-threads',
executable('test-threads',
'mu-query-threads.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, lib_mu_dep]))
test('test-contacts-cache',
executable('test-contacts-cache',
'mu-contacts-cache.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, lib_mu_dep]))

test('test-config',
executable('test-config',
'mu-config.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, lib_mu_dep]))

test('test-query-macros',
executable('test-query-macros',
'mu-query-macros.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [lib_mu_dep]))

test('test-query-processor',
executable('test-query-processor',
'mu-query-processor.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [lib_mu_dep]))

test('test-query-parser',
executable('test-query-parser',
'mu-query-parser.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [lib_mu_dep]))

test('test-query-xapianizer',
executable('test-query-xapianizer',
'mu-query-xapianizer.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [lib_mu_dep]))


test('test-indexer',
executable('test-indexer', 'mu-indexer.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, config_h_dep,
lib_mu_dep]))

test('test-scanner',
executable('test-scanner', 'mu-scanner.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, config_h_dep,
lib_mu_utils_dep]))

test('test-xapian-db',
executable('test-xapian-db', 'mu-xapian-db.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [lib_mu_dep, config_h_dep]))


subdir('tests')
if not get_option('tests').disabled()
test('test-threads',
executable('test-threads',
'mu-query-threads.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, lib_mu_dep]))
test('test-contacts-cache',
executable('test-contacts-cache',
'mu-contacts-cache.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, lib_mu_dep]))

test('test-config',
executable('test-config',
'mu-config.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, lib_mu_dep]))

test('test-query-macros',
executable('test-query-macros',
'mu-query-macros.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [lib_mu_dep]))

test('test-query-processor',
executable('test-query-processor',
'mu-query-processor.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [lib_mu_dep]))

test('test-query-parser',
executable('test-query-parser',
'mu-query-parser.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [lib_mu_dep]))

test('test-query-xapianizer',
executable('test-query-xapianizer',
'mu-query-xapianizer.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [lib_mu_dep]))


test('test-indexer',
executable('test-indexer', 'mu-indexer.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, config_h_dep,
lib_mu_dep]))

test('test-scanner',
executable('test-scanner', 'mu-scanner.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, config_h_dep,
lib_mu_utils_dep]))

test('test-xapian-db',
executable('test-xapian-db', 'mu-xapian-db.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [lib_mu_dep, config_h_dep]))


subdir('tests')
endif
96 changes: 49 additions & 47 deletions lib/message/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -46,57 +46,59 @@ lib_mu_message_dep = declare_dependency(
# tests
#

test('test-contact',
executable('test-contact',
'mu-contact.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, gmime_dep, lib_mu_message_dep]))
if not get_option('tests').disabled()
test('test-contact',
executable('test-contact',
'mu-contact.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, gmime_dep, lib_mu_message_dep]))

test('test-document',
executable('test-document',
'mu-document.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, gmime_dep, lib_mu_message_dep]))
test('test-document',
executable('test-document',
'mu-document.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, gmime_dep, lib_mu_message_dep]))

test('test-fields',
executable('test-fields',
'mu-fields.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, gmime_dep, lib_mu_message_dep]))
test('test-fields',
executable('test-fields',
'mu-fields.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, gmime_dep, lib_mu_message_dep]))

test('test-flags',
executable('test-flags',
'mu-flags.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, gmime_dep, lib_mu_message_dep]))
test('test-flags',
executable('test-flags',
'mu-flags.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, gmime_dep, lib_mu_message_dep]))

test('test-message',
executable('test-message',
'test-mu-message.cc',
install: false,
dependencies: [glib_dep, gmime_dep, lib_mu_message_dep]))
test('test-message',
executable('test-message',
'test-mu-message.cc',
install: false,
dependencies: [glib_dep, gmime_dep, lib_mu_message_dep]))

test('test-priority',
executable('test-priority',
'mu-priority.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, gmime_dep, lib_mu_message_dep]))
test('test-priority',
executable('test-priority',
'mu-priority.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, gmime_dep, lib_mu_message_dep]))

test('test-message-file',
executable('test-message-file',
'mu-message-file.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, lib_mu_message_dep]))
test('test-message-file',
executable('test-message-file',
'mu-message-file.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, lib_mu_message_dep]))

test('test-message-part',
executable('test-message-part',
'mu-message-part.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, lib_mu_message_dep]))
test('test-message-part',
executable('test-message-part',
'mu-message-part.cc',
install: false,
cpp_args: ['-DBUILD_TESTS'],
dependencies: [glib_dep, lib_mu_message_dep]))
endif
95 changes: 49 additions & 46 deletions lib/tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -17,53 +17,56 @@
#
# tests
#
test('test-maildir',
executable('test-maildir',
'test-mu-maildir.cc',
install: false,
dependencies: [glib_dep, lib_mu_dep]))
test('test-msg',
executable('test-msg',
'test-mu-msg.cc',
install: false,
dependencies: [glib_dep, lib_mu_dep]))
test('test-store',
executable('test-store',
'test-mu-store.cc',
install: false,
dependencies: [glib_dep, lib_mu_dep]))
test('test-query',
executable('test-query',
'test-query.cc',
install: false,
dependencies: [glib_dep, gmime_dep, lib_mu_dep]))

test('test-store-query',
executable('test-store-query',
'test-mu-store-query.cc',
install: false,
dependencies: [glib_dep, gmime_dep, lib_mu_dep]))
#
# benchmarks
#
bench_maildirs=join_paths(meson.current_build_dir(), 'maildirs')
bench_store=join_paths(meson.current_build_dir(), 'store')
bench_indexer_exe = executable(
'bench-indexer',
'bench-indexer.cc',
install:false,
cpp_args:['-DBENCH_MAILDIRS="' + bench_maildirs + '"',
'-DBENCH_STORE="' + bench_store + '"',
],
dependencies: [lib_mu_dep, glib_dep])
if not get_option('tests').disabled()
test('test-maildir',
executable('test-maildir',
'test-mu-maildir.cc',
install: false,
dependencies: [glib_dep, lib_mu_dep]))
test('test-msg',
executable('test-msg',
'test-mu-msg.cc',
install: false,
dependencies: [glib_dep, lib_mu_dep]))
test('test-store',
executable('test-store',
'test-mu-store.cc',
install: false,
dependencies: [glib_dep, lib_mu_dep]))
test('test-query',
executable('test-query',
'test-query.cc',
install: false,
dependencies: [glib_dep, gmime_dep, lib_mu_dep]))

benchmark('bench-indexer', bench_indexer_exe, args: ['-m', 'perf'])
test('test-store-query',
executable('test-store-query',
'test-mu-store-query.cc',
install: false,
dependencies: [glib_dep, gmime_dep, lib_mu_dep]))
#
# benchmarks
#
bench_maildirs=join_paths(meson.current_build_dir(), 'maildirs')
bench_store=join_paths(meson.current_build_dir(), 'store')
bench_indexer_exe = executable(
'bench-indexer',
'bench-indexer.cc',
install:false,
cpp_args:['-DBENCH_MAILDIRS="' + bench_maildirs + '"',
'-DBENCH_STORE="' + bench_store + '"',
],
dependencies: [lib_mu_dep, glib_dep])

#
# below does _not_ pass; it is believed that it's a false alarm.
# https://gitlab.gnome.org/GNOME/glib/-/issues/2662
benchmark('bench-indexer', bench_indexer_exe, args: ['-m', 'perf'])

#
# below does _not_ pass; it is believed that it's a false alarm.
# https://gitlab.gnome.org/GNOME/glib/-/issues/2662

# also register benchmark as a normal test so it gets included for
# valgrind/helgrind etc.
# test('test-bench-indexer', bench_indexer_exe,
# args : ['-m', 'quick'], env: ['THREADNUM=16'])
# also register benchmark as a normal test so it gets included for
# valgrind/helgrind etc.
# test('test-bench-indexer', bench_indexer_exe,
# args : ['-m', 'quick'], env: ['THREADNUM=16'])
endif
Loading
Loading