Make C unit tests more robust
authorDan Scott <dscott@laurentian.ca>
Wed, 21 Aug 2013 15:57:40 +0000 (11:57 -0400)
committerJason Etheridge <jason@esilibrary.com>
Wed, 21 Aug 2013 19:45:10 +0000 (15:45 -0400)
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 <dscott@laurentian.ca>
Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Open-ILS/src/c-apps/Makefile.am
Open-ILS/src/c-apps/tests/Makefile.am

index 3006373..77d48e5 100644 (file)
@@ -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
index df9439f..67b258d 100644 (file)
@@ -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