summaryrefslogtreecommitdiff
path: root/src/platform/tests/Makefile.am
diff options
context:
space:
mode:
Diffstat (limited to 'src/platform/tests/Makefile.am')
-rw-r--r--src/platform/tests/Makefile.am116
1 files changed, 116 insertions, 0 deletions
diff --git a/src/platform/tests/Makefile.am b/src/platform/tests/Makefile.am
new file mode 100644
index 000000000..9b10ea7b2
--- /dev/null
+++ b/src/platform/tests/Makefile.am
@@ -0,0 +1,116 @@
+AM_CPPFLAGS = \
+ -I${top_srcdir} \
+ -I${top_srcdir}/include \
+ -I${top_builddir}/include \
+ -I${top_srcdir}/src \
+ -I${top_builddir}/src \
+ -I${top_srcdir}/src/logging \
+ -I${top_srcdir}/libnm-util \
+ -I${top_builddir}/libnm-util \
+ -I${srcdir}/.. \
+ -DG_LOG_DOMAIN=\""NetworkManager"\" \
+ -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
+ $(GLIB_CFLAGS) \
+ $(GUDEV_CFLAGS) \
+ $(LIBNL_CFLAGS)
+
+if REQUIRE_ROOT_TESTS
+AM_CPPFLAGS += -DREQUIRE_ROOT_TESTS=1
+endif
+
+PLATFORM_SOURCES = \
+ ../nm-platform.c \
+ ../nm-fake-platform.c \
+ ../nm-linux-platform.c
+TEST_SOURCES = $(PLATFORM_SOURCES) test-common.c test-common.h
+AM_CFLAGS = $(CODE_COVERAGE_CFLAGS)
+AM_LDFLAGS = $(GLIB_LIBS) $(GUDEV_LIBS) $(LIBNL_LIBS) $(CODE_COVERAGE_LDFLAGS)
+PLATFORM_LDADD = \
+ $(top_builddir)/src/libNetworkManager.la
+
+@GNOME_CODE_COVERAGE_RULES@
+
+noinst_PROGRAMS = \
+ dump \
+ monitor \
+ platform \
+ test-link-fake \
+ test-link-linux \
+ test-address-fake \
+ test-address-linux \
+ test-route-fake \
+ test-route-linux \
+ test-cleanup-fake \
+ test-cleanup-linux
+
+EXTRA_DIST = test-common.h
+
+monitor_SOURCES = monitor.c $(PLATFORM_SOURCES)
+monitor_LDADD = $(PLATFORM_LDADD)
+
+dump_SOURCES = dump.c $(PLATFORM_SOURCES)
+dump_LDADD = $(PLATFORM_LDADD)
+
+platform_SOURCES = platform.c $(PLATFORM_SOURCES)
+platform_LDADD = $(PLATFORM_LDADD)
+
+test_link_fake_SOURCES = test-link.c $(TEST_SOURCES)
+test_link_fake_CPPFLAGS = \
+ $(AM_CPPFLAGS) \
+ -DSETUP=nm_fake_platform_setup \
+ -DKERNEL_HACKS=0
+test_link_fake_LDADD = $(PLATFORM_LDADD)
+
+test_link_linux_SOURCES = test-link.c $(TEST_SOURCES)
+test_link_linux_CPPFLAGS = \
+ $(AM_CPPFLAGS) \
+ -DSETUP=nm_linux_platform_setup \
+ -DKERNEL_HACKS=1
+test_link_linux_LDADD = $(PLATFORM_LDADD)
+
+test_address_fake_SOURCES = test-address.c $(TEST_SOURCES)
+test_address_fake_CPPFLAGS = \
+ $(AM_CPPFLAGS) \
+ -DSETUP=nm_fake_platform_setup \
+ -DKERNEL_HACKS=0
+test_address_fake_LDADD = $(PLATFORM_LDADD)
+
+test_address_linux_SOURCES = test-address.c $(TEST_SOURCES)
+test_address_linux_CPPFLAGS = \
+ $(AM_CPPFLAGS) \
+ -DSETUP=nm_linux_platform_setup \
+ -DKERNEL_HACKS=1
+test_address_linux_LDADD = $(PLATFORM_LDADD)
+
+test_route_fake_SOURCES = test-route.c $(TEST_SOURCES)
+test_route_fake_CPPFLAGS = \
+ $(AM_CPPFLAGS) \
+ -DSETUP=nm_fake_platform_setup \
+ -DKERNEL_HACKS=0
+test_route_fake_LDADD = $(PLATFORM_LDADD)
+
+test_route_linux_SOURCES = test-route.c $(TEST_SOURCES)
+test_route_linux_CPPFLAGS = \
+ $(AM_CPPFLAGS) \
+ -DSETUP=nm_linux_platform_setup \
+ -DKERNEL_HACKS=1
+test_route_linux_LDADD = $(PLATFORM_LDADD)
+
+test_cleanup_fake_SOURCES = test-cleanup.c $(TEST_SOURCES)
+test_cleanup_fake_CPPFLAGS = \
+ $(AM_CPPFLAGS) \
+ -DSETUP=nm_fake_platform_setup \
+ -DKERNEL_HACKS=0
+test_cleanup_fake_LDADD = $(PLATFORM_LDADD)
+
+test_cleanup_linux_SOURCES = test-cleanup.c $(TEST_SOURCES)
+test_cleanup_linux_CPPFLAGS = \
+ $(AM_CPPFLAGS) \
+ -DSETUP=nm_linux_platform_setup \
+ -DKERNEL_HACKS=1
+test_cleanup_linux_LDADD = $(PLATFORM_LDADD)
+
+#@VALGRIND_RULES@
+TESTS = test-link-fake test-address-fake test-route-fake test-cleanup-fake test-link-linux test-address-linux test-route-linux test-cleanup-linux
+
+