trivial: Do not run any tests if configuring with -Denable-tests=false

This commit is contained in:
Richard Hughes 2017-06-07 21:07:32 +01:00
parent 748ae3154e
commit d80666281c
2 changed files with 44 additions and 40 deletions

View File

@ -125,6 +125,7 @@ gnome.generate_gir(dfu,
install : true install : true
) )
if get_option('enable-tests')
testdatadir = join_paths(meson.current_source_dir(), 'tests') testdatadir = join_paths(meson.current_source_dir(), 'tests')
cargs += '-DTESTDATADIR="' + testdatadir + '"' cargs += '-DTESTDATADIR="' + testdatadir + '"'
e = executable( e = executable(
@ -145,3 +146,4 @@ e = executable(
c_args : cargs c_args : cargs
) )
test('dfu-self-test', e) test('dfu-self-test', e)
endif

View File

@ -89,6 +89,7 @@ gnome.generate_gir(fwupd,
install : true install : true
) )
if get_option('enable-tests')
testdatadir = join_paths(meson.source_root(), 'data') testdatadir = join_paths(meson.source_root(), 'data')
e = executable( e = executable(
'fwupd-self-test', 'fwupd-self-test',
@ -109,3 +110,4 @@ e = executable(
], ],
) )
test('fwupd-self-test', e) test('fwupd-self-test', e)
endif