diff --git a/clients/common/tests/meson.build b/clients/common/tests/meson.build index b7784e7154..cc357cdc8c 100644 --- a/clients/common/tests/meson.build +++ b/clients/common/tests/meson.build @@ -16,4 +16,8 @@ exe = executable( ], ) -test(test_unit, exe) +test( + 'clients/' + test_unit, + test_script, + args: test_args + [exe.full_path()] +) diff --git a/dispatcher/tests/meson.build b/dispatcher/tests/meson.build index 8675271c58..1368a1f33c 100644 --- a/dispatcher/tests/meson.build +++ b/dispatcher/tests/meson.build @@ -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()] +) diff --git a/libnm-core/tests/meson.build b/libnm-core/tests/meson.build index b3d62d4741..6e8a2493d8 100644 --- a/libnm-core/tests/meson.build +++ b/libnm-core/tests/meson.build @@ -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 diff --git a/libnm-glib/tests/meson.build b/libnm-glib/tests/meson.build index 14c3a67bf5..029b3c20c5 100644 --- a/libnm-glib/tests/meson.build +++ b/libnm-glib/tests/meson.build @@ -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 diff --git a/libnm-util/tests/meson.build b/libnm-util/tests/meson.build index c1f7800a41..63535033f1 100644 --- a/libnm-util/tests/meson.build +++ b/libnm-util/tests/meson.build @@ -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 diff --git a/libnm/tests/meson.build b/libnm/tests/meson.build index 8edb9fbed5..c47814b336 100644 --- a/libnm/tests/meson.build +++ b/libnm/tests/meson.build @@ -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" diff --git a/meson.build b/meson.build index 65f1f89018..5f29c16a69 100644 --- a/meson.build +++ b/meson.build @@ -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') diff --git a/src/devices/tests/meson.build b/src/devices/tests/meson.build index c1d6def4eb..64afc278d6 100644 --- a/src/devices/tests/meson.build +++ b/src/devices/tests/meson.build @@ -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 diff --git a/src/devices/wifi/tests/meson.build b/src/devices/wifi/tests/meson.build index 05db2ffbb7..bb8f7c27f2 100644 --- a/src/devices/wifi/tests/meson.build +++ b/src/devices/wifi/tests/meson.build @@ -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()] +) diff --git a/src/dhcp/tests/meson.build b/src/dhcp/tests/meson.build index 2a6b55df2b..32badae8bc 100644 --- a/src/dhcp/tests/meson.build +++ b/src/dhcp/tests/meson.build @@ -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 diff --git a/src/dnsmasq/tests/meson.build b/src/dnsmasq/tests/meson.build index 56d917486a..40f42f6f80 100644 --- a/src/dnsmasq/tests/meson.build +++ b/src/dnsmasq/tests/meson.build @@ -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()] +) diff --git a/src/ndisc/tests/meson.build b/src/ndisc/tests/meson.build index 708ecf4122..2f479c2d9f 100644 --- a/src/ndisc/tests/meson.build +++ b/src/ndisc/tests/meson.build @@ -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' diff --git a/src/platform/tests/meson.build b/src/platform/tests/meson.build index 6c18241e7d..0571efacff 100644 --- a/src/platform/tests/meson.build +++ b/src/platform/tests/meson.build @@ -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' diff --git a/src/settings/plugins/ibft/tests/meson.build b/src/settings/plugins/ibft/tests/meson.build index d579895245..7a9445dd8a 100644 --- a/src/settings/plugins/ibft/tests/meson.build +++ b/src/settings/plugins/ibft/tests/meson.build @@ -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()] +) diff --git a/src/settings/plugins/ifcfg-rh/tests/meson.build b/src/settings/plugins/ifcfg-rh/tests/meson.build index 3be38bd3c6..3596b642c9 100644 --- a/src/settings/plugins/ifcfg-rh/tests/meson.build +++ b/src/settings/plugins/ifcfg-rh/tests/meson.build @@ -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()] +) diff --git a/src/settings/plugins/ifupdown/tests/meson.build b/src/settings/plugins/ifupdown/tests/meson.build index 287c89d2e4..7f210034b8 100644 --- a/src/settings/plugins/ifupdown/tests/meson.build +++ b/src/settings/plugins/ifupdown/tests/meson.build @@ -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()] +) diff --git a/src/settings/plugins/keyfile/tests/meson.build b/src/settings/plugins/keyfile/tests/meson.build index 1f32650b2c..54b4ee0d9d 100644 --- a/src/settings/plugins/keyfile/tests/meson.build +++ b/src/settings/plugins/keyfile/tests/meson.build @@ -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()] +) diff --git a/src/supplicant/tests/meson.build b/src/supplicant/tests/meson.build index 87acc7eb56..e6a86b20b4 100644 --- a/src/supplicant/tests/meson.build +++ b/src/supplicant/tests/meson.build @@ -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()] +) diff --git a/src/tests/config/meson.build b/src/tests/config/meson.build index 80d289f717..fb40d9a971 100644 --- a/src/tests/config/meson.build +++ b/src/tests/config/meson.build @@ -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()] +) diff --git a/src/tests/meson.build b/src/tests/meson.build index b87da713da..386ede8782 100644 --- a/src/tests/meson.build +++ b/src/tests/meson.build @@ -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()] +) diff --git a/tools/run-nm-test.sh b/tools/run-nm-test.sh index 2c23e7175f..7f3053ce17 100755 --- a/tools/run-nm-test.sh +++ b/tools/run-nm-test.sh @@ -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=