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,23 +125,25 @@ gnome.generate_gir(dfu,
install : true install : true
) )
testdatadir = join_paths(meson.current_source_dir(), 'tests') if get_option('enable-tests')
cargs += '-DTESTDATADIR="' + testdatadir + '"' testdatadir = join_paths(meson.current_source_dir(), 'tests')
e = executable( cargs += '-DTESTDATADIR="' + testdatadir + '"'
'dfu-self-test', e = executable(
sources : [ 'dfu-self-test',
'dfu-self-test.c' sources : [
], 'dfu-self-test.c'
include_directories : [ ],
include_directories('..'), include_directories : [
], include_directories('..'),
dependencies : [ ],
appstream_glib, dependencies : [
gio, appstream_glib,
gusb, gio,
libm, gusb,
], libm,
link_with : dfu, ],
c_args : cargs link_with : dfu,
) c_args : cargs
test('dfu-self-test', e) )
test('dfu-self-test', e)
endif

View File

@ -89,23 +89,25 @@ gnome.generate_gir(fwupd,
install : true install : true
) )
testdatadir = join_paths(meson.source_root(), 'data') if get_option('enable-tests')
e = executable( testdatadir = join_paths(meson.source_root(), 'data')
'fwupd-self-test', e = executable(
sources : [ 'fwupd-self-test',
'fwupd-self-test.c' sources : [
], 'fwupd-self-test.c'
include_directories : [ ],
include_directories('..'), include_directories : [
], include_directories('..'),
dependencies : [ ],
gio, dependencies : [
soup, gio,
], soup,
link_with : fwupd, ],
c_args : [ link_with : fwupd,
cargs, c_args : [
'-DFU_SELF_TEST_REMOTES_DIR="' + testdatadir + '"', cargs,
], '-DFU_SELF_TEST_REMOTES_DIR="' + testdatadir + '"',
) ],
test('fwupd-self-test', e) )
test('fwupd-self-test', e)
endif