Commit d8493662 authored by Inigo Martínez's avatar Inigo Martínez Committed by Thomas Haller

build: rename unit tests with the `test-` pattern

There are some tests located in different directories which are
using the same name. To avoid any confussion a prefix was used to
name the test and the target.

This patch uses the prefix just for the target, to avoid any
collision that may happen, and uses the `test-` pattern as the
name.

https://mail.gnome.org/archives/networkmanager-list/2017-December/msg00051.html
parent 8e009baa
test_unit = 'test-general'
name = 'client-' + test_unit
deps += [
libnmc_dep,
libnmc_base_dep
]
exe = executable(
name,
'clients-' + test_unit,
test_unit + '.c',
include_directories: incs,
dependencies: deps,
c_args: cflags
)
test(name, exe)
test(test_unit, exe)
......@@ -50,10 +50,8 @@ test_cert_dir = join_paths(meson.current_source_dir(), 'certs')
cflags = '-DTEST_CERT_DIR="@0@"'.format(test_cert_dir)
foreach test_unit: test_units
name = 'libnm-core-' + test_unit
exe = executable(
name,
'libnm-core-' + test_unit,
[test_unit + '.c', enums_c, enums_h],
include_directories: incs,
dependencies: glib_dep,
......@@ -61,5 +59,5 @@ foreach test_unit: test_units
link_with: libnm_core
)
test(name, exe)
test(test_unit, exe)
endforeach
......@@ -22,15 +22,13 @@ test_units = [
]
foreach test_unit: test_units
name = 'libnm-glib-' + test_unit
exe = executable(
name,
test_unit,
[test_unit + '.c', libnm_utils_enums_h] + shared_test_utils,
include_directories: incs,
dependencies: deps,
c_args: cflags
)
test(name, exe)
test(test_unit, exe)
endforeach
......@@ -35,10 +35,8 @@ test_units = [
]
foreach test_unit: test_units
name = 'libnm-utils-' + test_unit[0]
exe = executable(
name,
'libnm-util-' + test_unit[0],
[test_unit[0] + '.c', libnm_utils_enums_h],
include_directories: incs,
dependencies: deps,
......@@ -47,5 +45,5 @@ foreach test_unit: test_units
link_depends: test_unit[2]
)
test(name, exe)
test(test_unit[0], exe)
endforeach
......@@ -23,10 +23,8 @@ cflags = [
]
foreach test_unit: test_units
name = 'libnm-' + test_unit[0]
exe = executable(
name,
'libnm-' + test_unit[0],
[test_unit[0] + '.c'] + test_unit[1],
include_directories: incs,
dependencies: deps,
......@@ -34,7 +32,7 @@ foreach test_unit: test_units
link_with: test_unit[2]
)
test(name, exe)
test(test_unit[0], exe)
endforeach
incs = [
......
test_unit = 'test-general'
name = 'wifi-' + test_unit
exe = executable(
name,
'wifi-' + test_unit,
[test_unit + '.c'] + common_sources,
dependencies: test_core_dep
)
test(name, exe)
test(test_unit, exe)
......@@ -12,16 +12,14 @@ test_units = [
]
foreach test_unit: test_units
name = 'platform-' + test_unit[0]
exe = executable(
name,
'platform-' + test_unit[0],
test_unit[1],
dependencies: test_core_dep,
c_args: test_cflags_platform
)
test(name, exe)
test(test_unit[0], exe)
endforeach
test = 'monitor'
......
......@@ -12,24 +12,21 @@ test_units = [
]
foreach test_unit: test_units
name = 'tests-' + test_unit
exe = executable(
name,
test_unit,
test_unit + '.c',
dependencies: test_core_dep
)
test(name, exe)
test(test_unit, exe)
endforeach
test_unit = 'test-systemd'
name = 'tests-' + test_unit
cflags = '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_SYSTEMD'
exe = executable(
name,
test_unit,
[test_unit + '.c', libnm_core_enums_h] + shared_siphash,
include_directories: core_incs,
dependencies: glib_dep,
......@@ -37,4 +34,4 @@ exe = executable(
link_with: libsystemd_nm
)
test(name, exe)
test(test_unit, exe)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment