build: meson: merge branch 'bg/meson-tests'

Enable all tests when building with meson.
This commit is contained in:
Beniamino Galvani 2018-04-12 09:21:39 +02:00
commit ae8015b4a5
21 changed files with 123 additions and 33 deletions

View file

@ -16,4 +16,8 @@ exe = executable(
],
)
test(test_unit, exe)
test(
'clients/' + test_unit,
test_script,
args: test_args + [exe.full_path()]
)

View file

@ -20,4 +20,8 @@ exe = executable(
link_with: libnm_dispatcher_core
)
test(test_unit, exe)
test(
'dispatcher/' + test_unit,
test_script,
args: test_args + [exe.full_path()]
)

View file

@ -43,6 +43,9 @@ foreach test_unit: test_units
c_args: cflags,
link_with: libnm_core
)
test(test_unit, exe)
test(
'libnm-core/' + test_unit,
test_script,
args: test_args + [exe.full_path()]
)
endforeach

View file

@ -7,9 +7,8 @@ deps = [
]
test_units = [
# FIXME: these tests currently fail
#'test-nm-client',
#'test-remote-settings-client'
'test-nm-client',
'test-remote-settings-client'
]
foreach test_unit: test_units
@ -23,5 +22,9 @@ foreach test_unit: test_units
],
)
test(test_unit, exe)
test(
'libnm-glib/' + test_unit,
test_script,
args: test_args + [exe.full_path()]
)
endforeach

View file

@ -39,5 +39,9 @@ foreach test_unit: test_units
link_depends: test_unit[2]
)
test(test_unit[0], exe)
test(
'libnm-util/' + test_unit[0],
test_script,
args: test_args + [exe.full_path()]
)
endforeach

View file

@ -1,9 +1,8 @@
test_units = [
['test-general', shared_utils, [libnm_utils]],
# FIXME: these tests fails usually
#['test-nm-client', shared_test_utils, []],
#['test-remote-settings-client', shared_test_utils, []],
#['test-secret-agent', shared_test_utils, []]
['test-nm-client', shared_test_utils, []],
['test-remote-settings-client', shared_test_utils, []],
['test-secret-agent', shared_test_utils, []]
]
deps = [
@ -26,7 +25,11 @@ foreach test_unit: test_units
link_with: test_unit[2]
)
test(test_unit[0], exe)
test(
'libnm/' + test_unit[0],
test_script,
args: test_args + [exe.full_path()]
)
endforeach
# just test, that we can build "nm-vpn-plugin-utils.c"

View file

@ -209,8 +209,6 @@ have_systemd_200 = systemd_dep.found() and systemd_dep.version().version_compare
gio_unix_dep = dependency('gio-unix-2.0', version: '>= 2.40')
log_driver = join_paths(meson.source_root(), 'build-aux', (gio_unix_dep.version().version_compare('>= 2.37.6') ? 'tap-driver.sh' : 'test-driver'))
glib_dep = declare_dependency(
dependencies: [
gio_unix_dep,
@ -724,6 +722,7 @@ endif
tests = get_option('tests')
enable_tests = (tests != 'no')
require_root_tests = (tests == 'root')
test_script = find_program(join_paths(meson.source_root(), 'tools', 'run-nm-test.sh'))
# valgrind
locations = get_option('valgrind')
@ -740,6 +739,14 @@ if enable_valgrind
endif
endif
test_args = [
'--called-from-make',
'',
enable_valgrind ? valgrind.path() : '',
enable_valgrind ? valgrind_suppressions_path : '',
'--launch-dbus=auto'
]
# FIXME
#AC_SUBST(NM_LOG_COMPILER, 'LOG_COMPILER = "$(top_srcdir)/tools/run-nm-test.sh" --called-from-make "$(LIBTOOL)" "$(with_valgrind)" "'"$with_valgrind_suppressions"'" --launch-dbus=auto')

View file

@ -10,5 +10,9 @@ foreach test_unit: test_units
dependencies: test_nm_dep
)
test(test_unit, exe)
test(
'devices/' + test_unit,
test_script,
args: test_args + [exe.full_path()]
)
endforeach

View file

@ -6,4 +6,8 @@ exe = executable(
dependencies: test_nm_dep
)
test(test_unit, exe)
test(
'devices/wifi/' + test_unit,
test_script,
args: test_args + [exe.full_path()]
)

View file

@ -11,5 +11,9 @@ foreach test_unit: test_units
c_args: '-DTESTDIR="@0@"'.format(meson.current_source_dir())
)
test(test_unit, exe)
test(
'dhcp/' + test_unit,
test_script,
args: test_args + [exe.full_path()]
)
endforeach

View file

@ -7,4 +7,8 @@ exe = executable(
c_args: '-DTESTDIR="@0@"'.format(meson.source_root())
)
test(test_unit, exe)
test(
'dnsmasq/' + test_unit,
test_script,
args: test_args + [exe.full_path()]
)

View file

@ -7,7 +7,11 @@ exe = executable(
c_args: test_cflags_platform
)
test(test_unit, exe)
test(
'ndisc/' + test_unit,
test_script,
args: test_args + [exe.full_path()]
)
test = 'test-ndisc-linux'

View file

@ -1,6 +1,6 @@
test_units = [
['test-link-fake', 'test-link.c'],
['test-link-linux', 'test-link.c'],
['test-link-fake', 'test-link.c', 60],
['test-link-linux', 'test-link.c', 60],
['test-address-fake', 'test-address.c'],
['test-address-linux', 'test-address.c'],
['test-general', 'test-general.c'],
@ -19,7 +19,12 @@ foreach test_unit: test_units
c_args: test_cflags_platform
)
test(test_unit[0], exe)
test(
'platform/' + test_unit[0],
test_script,
timeout: test_unit.length() > 2 ? test_unit[2] : 30,
args: test_args + [exe.full_path()]
)
endforeach
test = 'monitor'

View file

@ -15,4 +15,8 @@ exe = executable(
link_with: libnms_ibft_core
)
test(test_unit, exe)
test(
'ibft/' + test_unit,
test_script,
args: test_args + [exe.full_path()]
)

View file

@ -15,4 +15,8 @@ exe = executable(
link_with: libnms_ifcfg_rh_core
)
test(test_unit, exe)
test(
'ifcfg-rh/' + test_unit,
test_script,
args: test_args + [exe.full_path()]
)

View file

@ -10,4 +10,8 @@ exe = executable(
link_with: libnms_ifupdown_core
)
test(test_unit, exe)
test(
'ifupdown/' + test_unit,
test_script,
args: test_args + [exe.full_path()]
)

View file

@ -14,4 +14,8 @@ exe = executable(
c_args: cflags
)
test(test_unit, exe)
test(
'keyfile/' + test_unit,
test_script,
args: test_args + [exe.full_path()]
)

View file

@ -7,4 +7,8 @@ exe = executable(
c_args: '-DTEST_CERT_DIR="@0@"'.format(join_paths(meson.current_source_dir(), 'certs'))
)
test(test_unit, exe)
test(
'supplicant/' + test_unit,
test_script,
args: test_args + [exe.full_path()]
)

View file

@ -19,4 +19,8 @@ exe = executable(
c_args: cflags
)
test(test_unit, exe)
test(
'config/' + test_unit,
test_script,
args: test_args + [exe.full_path()]
)

View file

@ -17,7 +17,11 @@ foreach test_unit: test_units
dependencies: test_nm_dep
)
test(test_unit, exe)
test(
'src/' + test_unit,
test_script,
args: test_args + [exe.full_path()]
)
endforeach
test_unit = 'test-systemd'
@ -36,4 +40,8 @@ exe = executable(
link_with: libsystemd_nm
)
test(test_unit, exe)
test(
'src/' + test_unit,
test_script,
args: test_args + [exe.full_path()]
)

View file

@ -35,7 +35,12 @@ else
fi
if [ "$CALLED_FROM_MAKE" == 1 ]; then
NMTST_LIBTOOL=($1 --mode=execute); shift
if [ -n "$1" ]; then
NMTST_LIBTOOL=($1 --mode=execute);
else
NMTST_LIBTOOL=()
fi
shift
NMTST_VALGRIND_ARG="$1"; shift
if [[ "$NMTST_VALGRIND_ARG" == no ]]; then
NMTST_VALGRIND_ARG=