meson: add tests and option to disable them

This enables building the Luppp unit tests with Meson,
and adds an option to disable building those tests. For
a release, the option should probably be off - although
currently it has no significant impact on the result.

Signed-off-by: Harry van Haaren <harryhaaren@gmail.com>
main
Harry van Haaren 2018-03-03 21:16:21 +00:00
parent 48802f14ad
commit f34a44e775
4 changed files with 19 additions and 3 deletions

View File

@ -1,10 +1,16 @@
project('openav_luppp', ['c','cpp'])
project( 'openav_luppp', ['c','cpp'],
default_options : [
'cpp_std=c++11',
])
conf_data = configuration_data()
conf_data.set('version', '1.1.1')
#add_project_arguments('-std=c99', language : 'c')
#add_project_arguments('-std=c++11', language : 'cpp')
if(get_option('tests') == true)
add_project_arguments('-DBUILD_TESTS', language : 'cpp')
endif
add_project_arguments('-Wno-unused-variable', language : 'cpp')
add_project_arguments('-Wno-reorder', language : 'cpp')
add_project_arguments('-Wno-sign-compare', language : 'cpp')

1
meson_options.txt Normal file
View File

@ -0,0 +1 @@
option('tests', type : 'boolean', value : true, description : 'Build tests')

View File

@ -30,3 +30,7 @@ subdir('controller')
subdir('observer')
subdir('state')
subdir('avtk')
if(get_option('tests') == true)
subdir('tests')
endif

5
src/tests/meson.build Normal file
View File

@ -0,0 +1,5 @@
luppp_src += files(
'diskreadertest.cxx',
'diskwritertest.cxx',
'goptionstest.cxx',
'gridlogictests.cxx')