/src/tests/test-resolvconf-capture
/src/tests/test-route-manager-fake
/src/tests/test-route-manager-linux
+/src/tests/test-systemd
/src/tests/test-utils
/src/tests/test-wired-defname
libsystemd_nm_la_LIBADD = \
$(GLIB_LIBS)
+######################
+# libsystemd-nm-base
+######################
+
+if ENABLE_TESTS
+noinst_LTLIBRARIES += \
+ libNetworkManager-base.la
+
+libNetworkManager_base_la_SOURCES = \
+ nm-core-utils.c \
+ nm-core-utils.h \
+ nm-logging.c \
+ nm-logging.h
+
+libNetworkManager_base_la_CPPFLAGS = \
+ -I$(top_srcdir)/shared \
+ -I$(top_builddir)/shared \
+ -I$(top_srcdir)/libnm-core \
+ -I$(top_builddir)/libnm-core \
+ -I$(top_srcdir)/src/platform \
+ -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
+ -DNO_SYSTEMD_JOURNAL \
+ -DPREFIX=\"$(prefix)\" \
+ -DNMSTATEDIR=\"$(nmstatedir)\" \
+ $(GLIB_CFLAGS)
+
+libNetworkManager_base_la_LIBADD = \
+ $(top_builddir)/libnm-core/libnm-core.la \
+ $(GLIB_LIBS)
+endif
+
###########################################
# NetworkManager
###########################################
#include <strings.h>
#include <string.h>
+#if defined (NO_SYSTEMD_JOURNAL) && defined (SYSTEMD_JOURNAL)
+#undef SYSTEMD_JOURNAL
+#define SYSTEMD_JOURNAL 0
+#endif
+
#if SYSTEMD_JOURNAL
#define SD_JOURNAL_SUPPRESS_LOCATION
#include <systemd/sd-journal.h>
test-route-manager-linux \
test-route-manager-fake \
test-dcb \
+ test-systemd \
test-resolvconf-capture \
test-wired-defname \
test-utils
test_wired_defname_LDADD = \
$(top_builddir)/src/libNetworkManager.la
+####### systemd test #######
+
+test_systemd_CFLAGS = \
+ "-I$(srcdir)/../" \
+ "-I$(srcdir)/../platform" \
+ "-I$(srcdir)/../systemd/src/systemd"
+
+test_systemd_SOURCES = \
+ test-systemd.c
+
+test_systemd_LDADD = \
+ $(top_builddir)/src/libNetworkManager-base.la \
+ $(top_builddir)/src/libsystemd-nm.la
+
####### utils test #######
test_utils_SOURCES = \
test-resolvconf-capture \
test-general \
test-general-with-expect \
+ test-systemd \
test-wired-defname \
test-utils
--- /dev/null
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Copyright (C) 2016 Red Hat, Inc.
+ */
+
+#include "nm-default.h"
+
+#include "sd-dhcp-client.h"
+
+#include "nm-test-utils.h"
+
+/*****************************************************************************/
+
+static void
+test_dhcp_create (void)
+{
+ sd_dhcp_client *client4 = NULL;
+ int r;
+
+ r = sd_dhcp_client_new (&client4);
+ g_assert (r == 0);
+ g_assert (client4);
+
+ sd_dhcp_client_unref (client4);
+}
+
+/*****************************************************************************/
+
+NMTST_DEFINE ();
+
+int
+main (int argc, char **argv)
+{
+ nmtst_init_assert_logging (&argc, &argv, "INFO", "ALL");
+
+ g_test_add_func ("/systemd/dhcp/create", test_dhcp_create);
+
+ return g_test_run ();
+}