]> granicus.if.org Git - libnl/commitdiff
tests: Convert tests/Makefile to use automake
authorThomas Graf <tgraf@redhat.com>
Sat, 21 Apr 2012 08:34:43 +0000 (10:34 +0200)
committerThomas Graf <tgraf@redhat.com>
Sat, 21 Apr 2012 08:34:43 +0000 (10:34 +0200)
Makefile.am
configure.in
tests/Makefile [deleted file]
tests/Makefile.am [new file with mode: 0644]

index e21060fcbce7bcda5cc9be2501828d0ad43c7cb8..c4617c4ca06dbf42290b90473e5f35657ba80692 100644 (file)
@@ -2,7 +2,7 @@
 
 ACLOCAL_AMFLAGS = -I m4
 
-SUBDIRS = include lib doc man python
+SUBDIRS = include lib doc man python tests
 
 pkgconfig_DATA = libnl-3.0.pc \
                 libnl-route-3.0.pc \
index b6060c78e4d8b7fa37f12afe8dac9a3601e9bd3a..9d99db2c9ed56dfc542820e6638f47ffb7b9e3a7 100644 (file)
@@ -84,6 +84,7 @@ lib/Makefile
 include/Makefile
 src/Makefile
 src/lib/Makefile
+tests/Makefile
 man/Makefile
 python/Makefile
 python/setup.py
diff --git a/tests/Makefile b/tests/Makefile
deleted file mode 100644 (file)
index d072ddb..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# src/Makefile
-#
-#      This library is free software; you can redistribute it and/or
-#      modify it under the terms of the GNU Lesser General Public
-#      License as published by the Free Software Foundation version 2.1
-#      of the License.
-#
-# Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch>
-#
-
-ifeq ($(shell [ ! -r ../Makefile.opts ] && echo 1),)
-    include ../Makefile.opts
-endif
-
-LDFLAGS        += -L../lib -lnl -lnl-genl -lnl-route
-CIN    := $(wildcard test-*.c)
-TESTS  := $(CIN:%.c=%)
-
-all: $(TESTS)
-
-test-%: test-%.c
-       @echo "  LD $@"; \
-       $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
-
-clean:
-       @echo "  CLEAN src"; \
-       rm -f $(TESTS)
-
-distclean: clean
-
-install:
-       @true
diff --git a/tests/Makefile.am b/tests/Makefile.am
new file mode 100644 (file)
index 0000000..4193818
--- /dev/null
@@ -0,0 +1,31 @@
+# -*- Makefile -*-
+
+AM_CPPFLAGS  = -Wall -I${top_srcdir}/include -I${top_builddir}/include -D_GNU_SOURCE -DSYSCONFDIR=\"$(sysconfdir)/libnl\"
+
+LDADD = \
+       ${top_builddir}/src/lib/libnl-cli-3.la \
+       ${top_builddir}/lib/libnl-3.la \
+       ${top_builddir}/lib/libnl-nf-3.la \
+       ${top_builddir}/lib/libnl-genl-3.la \
+       ${top_builddir}/lib/libnl-route-3.la
+
+check_PROGRAMS = \
+       test-cache-mngr \
+       test-create-bond \
+       test-create-vlan \
+       test-delete-link \
+       test-genl \
+       test-nf-cache-mngr \
+       test-socket-creation
+
+# Eventually add these to TESTS once converted to be real
+# test programs
+# TESTS = $(check_PROGRAMS)
+
+test_cache_mngr_SOURCES = test-cache-mngr.c
+test_create_bond_SOURCES = test-create-bond.c
+test_create_vlan_SOURCES = test-create-vlan.c
+test_delete_link_SOURCES = test-delete-link.c
+test_genl_SOURCES = test-genl.c
+test_nf_cache_mngr_SOURCES = test-nf-cache-mngr.c
+test_socket_creation_SOURCES = test-socket-creation.c