From 285de25e7ccee2e42de43c4cef7f4f4702c25111 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Wed, 21 Aug 2013 11:57:40 -0400 Subject: [PATCH] Make C unit tests more robust Adding -I@abs_top_srcdir@/Open-ILS/include will pull in the source tree header files, so that the C unit tests can run before Evergreen has been installed (and thus will be a valid test of the source header files instead of relying on the installed versions that might be different). Build c-apps before recursing into c-apps/tests: This ensures that the required libraries are built before the C unit tests are built, thus preventing "make check" on a just-configured source tree from failing due to missing dependencies. Also, link to the source tree directories first rather than last, to ensure that we pull in the correct source (if possible). And remove the cargo-cultish $(TMP) linking/including. Signed-off-by: Dan Scott --- Open-ILS/src/c-apps/Makefile.am | 2 +- Open-ILS/src/c-apps/tests/Makefile.am | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/c-apps/Makefile.am b/Open-ILS/src/c-apps/Makefile.am index 3006373ffb..77d48e5e8a 100644 --- a/Open-ILS/src/c-apps/Makefile.am +++ b/Open-ILS/src/c-apps/Makefile.am @@ -4,7 +4,7 @@ # Process this file with automake to generate Makefile.in #----------------------------------------------------------- -SUBDIRS = tests +SUBDIRS = . tests AM_CFLAGS = $(DEF_CFLAGS) -DOSRF_LOG_PARAMS -I@top_srcdir@/include/ AM_LDFLAGS = $(DEF_LDFLAGS) -L$(DBI_LIBS) -lopensrf diff --git a/Open-ILS/src/c-apps/tests/Makefile.am b/Open-ILS/src/c-apps/tests/Makefile.am index df9439f6f7..67b258d6b3 100644 --- a/Open-ILS/src/c-apps/tests/Makefile.am +++ b/Open-ILS/src/c-apps/tests/Makefile.am @@ -1,10 +1,10 @@ -export DEF_LDFLAGS = -L. -L$(TMP) -L$(OPENSRF_LIBS) -export DEF_CFLAGS = -D_LARGEFILE64_SOURCE -pipe -g -Wall -O2 -fPIC -I@top_srcdir@/include -I$(LIBXML2_HEADERS) -I$(APACHE2_HEADERS) -I$(APR_HEADERS) -I$(LIBXML2_HEADERS)/libxml -I$(TMP) -I$(OPENSRF_HEADERS) +export DEF_LDFLAGS = -L@abs_top_srcdir@/Open-ILS/src/c-apps -L$(OPENSRF_LIBS) +export DEF_CFLAGS = -D_LARGEFILE64_SOURCE -pipe -g -Wall -O2 -fPIC -I@abs_top_srcdir@/Open-ILS/include -I$(LIBXML2_HEADERS) -I$(APACHE2_HEADERS) -I$(APR_HEADERS) -I$(LIBXML2_HEADERS)/libxml -I$(OPENSRF_HEADERS) export DEF_LDLIBS = -lopensrf COMMON = testsuite.c AM_CFLAGS = $(DEF_CFLAGS) -DOSRF_LOG_PARAMS -AM_LDFLAGS = $(DEF_LDLIBS) -L$(DBI_LIBS) +AM_LDFLAGS = $(DEF_LDFLAGS) $(DEF_LDLIBS) -L$(DBI_LIBS) TESTS = check_util check_idl check_PROGRAMS = check_util check_idl -- 2.11.0