Do not build tests in release mode

Assertions would not be executed.

And as a side effect, it causes "unused variable" warnings.
This commit is contained in:
Romain Vimont 2019-12-09 23:23:40 +01:00
parent ba1b36758e
commit e4cebc8d4c

View file

@ -141,40 +141,43 @@ install_man('scrcpy.1')
### TESTS ### TESTS
tests = [ # do not build tests in release (assertions would not be executed at all)
['test_buffer_util', [ if get_option('buildtype') == 'debug'
'tests/test_buffer_util.c' tests = [
]], ['test_buffer_util', [
['test_cbuf', [ 'tests/test_buffer_util.c'
'tests/test_cbuf.c', ]],
]], ['test_cbuf', [
['test_cli', [ 'tests/test_cbuf.c',
'tests/test_cli.c', ]],
'src/cli.c', ['test_cli', [
'src/util/str_util.c', 'tests/test_cli.c',
]], 'src/cli.c',
['test_control_event_serialize', [ 'src/util/str_util.c',
'tests/test_control_msg_serialize.c', ]],
'src/control_msg.c', ['test_control_event_serialize', [
'src/util/str_util.c', 'tests/test_control_msg_serialize.c',
]], 'src/control_msg.c',
['test_device_event_deserialize', [ 'src/util/str_util.c',
'tests/test_device_msg_deserialize.c', ]],
'src/device_msg.c', ['test_device_event_deserialize', [
]], 'tests/test_device_msg_deserialize.c',
['test_queue', [ 'src/device_msg.c',
'tests/test_queue.c', ]],
]], ['test_queue', [
['test_strutil', [ 'tests/test_queue.c',
'tests/test_strutil.c', ]],
'src/util/str_util.c', ['test_strutil', [
]], 'tests/test_strutil.c',
] 'src/util/str_util.c',
]],
]
foreach t : tests foreach t : tests
exe = executable(t[0], t[1], exe = executable(t[0], t[1],
include_directories: src_dir, include_directories: src_dir,
dependencies: dependencies, dependencies: dependencies,
c_args: ['-DSDL_MAIN_HANDLED']) c_args: ['-DSDL_MAIN_HANDLED'])
test(t[0], exe) test(t[0], exe)
endforeach endforeach
endif