From e48ffb852212a31e4bacc48ea8eb26b6582f4754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= <ondrej@sury.org> Date: Fri, 25 Feb 2011 16:22:52 +0100 Subject: [PATCH] Enable unittests build again --- Makefile.am | 2 +- configure.ac | 6 +++- src/Makefile.am | 80 ++++++++++++++++++++++++++++++++----------------- 3 files changed, 58 insertions(+), 30 deletions(-) diff --git a/Makefile.am b/Makefile.am index ba2ebc98f9..0a7b929961 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,2 +1,2 @@ -ACLOCAL_AMFLAGS = -Im4 +ACLOCAL_AMFLAGS = -I m4 SUBDIRS = src diff --git a/configure.ac b/configure.ac index 9e9eafe2ad..059968baa8 100644 --- a/configure.ac +++ b/configure.ac @@ -2,15 +2,19 @@ AC_PREREQ([2.67]) AC_INIT([knot], [0.2], [bug-me-knot@nic.cz]) -AM_INIT_AUTOMAKE([foreign -Wall -Werror]) +AM_INIT_AUTOMAKE([gnu -Wall -Werror]) AC_CONFIG_SRCDIR([src/main.c]) AC_CONFIG_HEADERS([src/config.h]) AC_CONFIG_MACRO_DIR([m4]) +# Enable maintainer mode by default for development +AM_MAINTAINER_MODE([enable]) + # Set compiler compatibility flags AC_PROG_CPP_WERROR AC_PROG_CC_STDC AC_PROG_CC_C99 +AC_USE_SYSTEM_EXTENSIONS([_GNU_SOURCE]) # Initialize libtool LT_INIT diff --git a/src/Makefile.am b/src/Makefile.am index 1d0af0b11c..9e144293b7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,11 +1,10 @@ -ACLOCAL_AMFLAGS = -I../m4 +ACLOCAL_AMFLAGS = -I ../m4 bin_PROGRAMS = knotc -libexec_PROGRAMS = knot-zoneparser -sbin_PROGRAMS = knot +libexec_PROGRAMS = knot-zoneparser unittests +sbin_PROGRAMS = knotd # FIXME: Move header files to $(topdir)/include AM_CFLAGS = \ - -I. \ -std=gnu99 \ -D_XOPEN_SOURCE=600 \ -D_GNU_SOURCE @@ -15,7 +14,20 @@ AM_YFLAGS = -d LDADD = libknot.a @LIBOBJS@ -TESTS = unittest +BUILT_SOURCES = \ + tests/dnslib/parsed_data.rc \ + tests/dnslib/raw_data_queries.rc \ + tests/dnslib/raw_data.rc \ + tests/dnslib/parsed_data_queries.rc + +CLEANFILES = \ + tests/dnslib/parsed_data.rc \ + tests/dnslib/raw_data_queries.rc \ + tests/dnslib/raw_data.rc \ + tests/dnslib/parsed_data_queries.rc \ + zparser.h \ + zparser.c \ + zlexer.c knotc_SOURCES = \ ctl/knotc_main.c @@ -23,28 +35,26 @@ knotc_SOURCES = \ knot_zoneparser_SOURCES = \ zoneparser/zoneparser_main.c -#unittests_SOURCES = \ -# tests/zonedb_tests.c \ -# tests/dnslib_tests.c \ -# tests/dthreads_tests.c \ -# tests/libtap/tap.c \ -# tests/da_tests.c \ -# tests/server_tests.c \ -# tests/slab_tests.c \ -# tests/template_tests.c \ -# tests/dnslib/dnslib_response_tests.c \ -# tests/dnslib/dnslib_zone_tests.c \ -# tests/dnslib/dnslib_rrsig_set_tests.c \ -# tests/dnslib/dnslib_rrset_tests.c \ -# tests/dnslib/dnslib_edns_tests.c \ -# tests/dnslib/dnslib_rdata_tests.c \ -# tests/dnslib/dnslib_node_tests.c \ -# tests/dnslib/dnslib_dname_tests.c \ -# tests/skiplist_tests.c \ -# tests/cuckoo_tests.c \ -# tests/unittests_main.c - -knot_SOURCES = \ +unittests_SOURCES = \ + tests/zonedb_tests.c \ + tests/dnslib_tests.c \ + tests/dthreads_tests.c \ + tests/libtap/tap.c \ + tests/da_tests.c \ + tests/server_tests.c \ + tests/slab_tests.c \ + tests/template_tests.c \ + tests/skiplist_tests.c \ + tests/cuckoo_tests.c \ + tests/unittests_main.c + +nodist_unittests_SOURCES = \ + tests/dnslib/parsed_data.rc \ + tests/dnslib/raw_data_queries.rc \ + tests/dnslib/raw_data.rc \ + tests/dnslib/parsed_data_queries.rc + +knotd_SOURCES = \ main.c noinst_LIBRARIES = libknot.a @@ -127,10 +137,24 @@ libknot_a_SOURCES = \ hash/universal-system.h \ hash/cuckoo-hash-table.h \ hash/hash-functions.h \ - config.h \ other/print.h \ other/log.h \ other/debug.h libknot_a_LIBADD = @LIBOBJS@ +# automake complains on % rules: +# `%'-style pattern rules are a GNU make extension + +tests/dnslib/parsed_data.rc: tests/files/parsed_data + ../resource.sh $< >$@ + +tests/dnslib/parsed_data_queries.rc: tests/files/parsed_data_queries + ../resource.sh $< >$@ + +tests/dnslib/raw_data_queries.rc: tests/files/raw_data_queries + ../resource.sh $< >$@ + +tests/dnslib/raw_data.rc: tests/files/raw_data + ../resource.sh $< >$@ + -- GitLab