summaryrefslogtreecommitdiff
path: root/dispatcher
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-05-30 10:23:17 +0200
committerThomas Haller <thaller@redhat.com>2018-05-31 15:59:38 +0200
commitb7426e91dbcbc9080e0018a43efd0aec1f5fc5ba (patch)
tree22481b509a9bc114f4180987877b75ce3455e77b /dispatcher
parent7fcf33908be0ec10c7ed8a2a36bf8bf516058f5e (diff)
downloadNetworkManager-b7426e91dbcbc9080e0018a43efd0aec1f5fc5ba.tar.gz
build: use default NM_BUILD_* defines for tests
Use two common defines NM_BUILD_SRCDIR and NM_BUILD_BUILDDIR for specifying the location of srcdir and builddir. Note that this is only relevant for tests, as they expect a certain layout of the directories, to find files that concern them.
Diffstat (limited to 'dispatcher')
-rw-r--r--dispatcher/tests/meson.build12
-rw-r--r--dispatcher/tests/test-dispatcher-envp.c5
2 files changed, 8 insertions, 9 deletions
diff --git a/dispatcher/tests/meson.build b/dispatcher/tests/meson.build
index 1368a1f33c..6ead88bf87 100644
--- a/dispatcher/tests/meson.build
+++ b/dispatcher/tests/meson.build
@@ -5,18 +5,16 @@ incs = [
libnm_inc
]
-cflags = [
- '-DNETWORKMANAGER_COMPILATION_TEST',
- '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT',
- '-DSRCDIR="@0@"'.format(meson.current_source_dir()),
-]
-
exe = executable(
test_unit,
test_unit + '.c',
include_directories: incs,
dependencies: nm_core_dep,
- c_args: cflags,
+ c_args: [
+ '-DNETWORKMANAGER_COMPILATION_TEST',
+ '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT',
+ ] +
+ nm_build_cflags,
link_with: libnm_dispatcher_core
)
diff --git a/dispatcher/tests/test-dispatcher-envp.c b/dispatcher/tests/test-dispatcher-envp.c
index 6316cd5706..1203c6ac04 100644
--- a/dispatcher/tests/test-dispatcher-envp.c
+++ b/dispatcher/tests/test-dispatcher-envp.c
@@ -29,6 +29,8 @@
#include "nm-utils/nm-test-utils.h"
+#define TEST_DIR NM_BUILD_SRCDIR"/dispatcher/tests"
+
/*****************************************************************************/
static void
@@ -525,8 +527,7 @@ test_generic (const char *file, const char *override_vpn_ip_iface)
gs_strfreev char **denv = NULL;
char **iter;
- /* Read in the test file */
- p = g_build_filename (SRCDIR, file, NULL);
+ p = g_build_filename (TEST_DIR, file, NULL);
success = get_dispatcher_file (p,
&con_dict,
&con_props,