1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

unit tests: more build adjustments

This commit is contained in:
Yang Tse 2011-06-01 21:39:18 +02:00
parent d6bb8dcc23
commit aa76dec33a
5 changed files with 25 additions and 25 deletions

View File

@ -305,6 +305,8 @@ AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes)
CURL_CHECK_CURLDEBUG CURL_CHECK_CURLDEBUG
AM_CONDITIONAL(CURLDEBUG, test x$want_curldebug = xyes) AM_CONDITIONAL(CURLDEBUG, test x$want_curldebug = xyes)
AM_CONDITIONAL(BUILD_UNITTESTS, test x$want_curldebug = xyes)
dnl ********************************************************************** dnl **********************************************************************
dnl Compilation based checks should not be done before this point. dnl Compilation based checks should not be done before this point.
dnl ********************************************************************** dnl **********************************************************************

View File

@ -106,7 +106,7 @@ endif
# For the full guide on libcurl ABI rules, see docs/libcurl/ABI # For the full guide on libcurl ABI rules, see docs/libcurl/ABI
if NO_UNDEFINED if NO_UNDEFINED
# The -no-undefined flag is CRUCIAL for this to build fine on Cygwin. # The -no-undefined flag is crucial to build fine on some platforms
UNDEF = -no-undefined UNDEF = -no-undefined
endif endif
@ -116,18 +116,18 @@ if MIMPURE
MIMPURE = -mimpure-text MIMPURE = -mimpure-text
endif endif
LINKFLAGS=$(UNDEF) $(MIMPURE) $(LIBCURL_LIBS) libcurl_la_LDFLAGS = $(UNDEF) $(VERSIONINFO) $(MIMPURE) $(LIBCURL_LIBS)
libcurl_la_LDFLAGS = $(LINKFLAGS) $(VERSIONINFO) # unit testing static library built only along with unit tests
if BUILD_UNITTESTS
# as unit testing will compile and link everything an extra time, we only
# do it if debug is enabled
if CURLDEBUG
noinst_LTLIBRARIES = libcurlu.la noinst_LTLIBRARIES = libcurlu.la
libcurlu_la_CPPFLAGS = $(AM_CPPFLAGS) -DUNITTESTS else
libcurlu_la_LDFLAGS = -static $(LINKFLAGS) noinst_LTLIBRARIES =
endif endif
libcurlu_la_CPPFLAGS = $(AM_CPPFLAGS) -DUNITTESTS
libcurlu_la_LDFLAGS = -static $(LIBCURL_LIBS)
# Makefile.inc provides the CSOURCES and HHEADERS defines # Makefile.inc provides the CSOURCES and HHEADERS defines
include Makefile.inc include Makefile.inc

View File

@ -30,7 +30,14 @@ EXTRA_DIST = ftpserver.pl httpserver.pl secureserver.pl runtests.pl getpart.pm \
serverhelp.pm tftpserver.pl rtspserver.pl directories.pm symbol-scan.pl \ serverhelp.pm tftpserver.pl rtspserver.pl directories.pm symbol-scan.pl \
certs/srp-verifier-conf certs/srp-verifier-db certs/srp-verifier-conf certs/srp-verifier-db
SUBDIRS = data server libtest unit if BUILD_UNITTESTS
BUILD_UNIT = unit
else
BUILD_UNIT =
endif
SUBDIRS = data server libtest $(BUILD_UNIT)
DIST_SUBDIRS = $(SUBDIRS) unit
PERLFLAGS = -I$(srcdir) PERLFLAGS = -I$(srcdir)

View File

@ -48,30 +48,21 @@ INCLUDES = -I$(top_builddir)/include/curl \
-I$(top_builddir)/include \ -I$(top_builddir)/include \
-I$(top_srcdir)/include \ -I$(top_srcdir)/include \
-I$(top_builddir)/lib \ -I$(top_builddir)/lib \
-I$(top_srcdir)/lib \ -I$(top_srcdir)/lib \
-I$(top_srcdir)/tests/libtest -I$(top_srcdir)/tests/libtest
endif endif
if CURLDEBUG
EXTRA_DIST = Makefile.inc EXTRA_DIST = Makefile.inc
LDADD = $(top_builddir)/lib/libcurlu.la @CURL_LIBS@ LDADD = $(top_builddir)/lib/libcurlu.la @CURL_LIBS@
DEPENDENCIES = $(top_builddir)/lib/libcurlu.la DEPENDENCIES = $(top_builddir)/lib/libcurlu.la
AM_CPPFLAGS = -DUNITTESTS AM_CPPFLAGS = -DUNITTESTS
# Makefile.inc provides the source defines (TESTUTIL, SUPPORTFILES, # Makefile.inc provides neat definitions
# noinst_PROGRAMS, lib*_SOURCES, and lib*_CFLAGS)
include Makefile.inc include Makefile.inc
if NO_UNDEFINED if BUILD_UNITTESTS
# The -no-undefined flag is crucial to build fine on some platforms noinst_PROGRAMS = $(UNITPROGS)
UNDEF = -no-undefined
endif
else else
# do nothing if debug was not enabled noinst_PROGRAMS =
all:
endif endif

View File

@ -5,7 +5,7 @@ UNITFILES = curlcheck.h \
$(top_srcdir)/tests/libtest/first.c $(top_srcdir)/tests/libtest/first.c
# These are all unit test programs # These are all unit test programs
noinst_PROGRAMS = unit1300 unit1301 unit1302 unit1303 unit1304 unit1305 unit1307 UNITPROGS = unit1300 unit1301 unit1302 unit1303 unit1304 unit1305 unit1307
unit1300_SOURCES = unit1300.c $(UNITFILES) unit1300_SOURCES = unit1300.c $(UNITFILES)
unit1301_SOURCES = unit1301.c $(UNITFILES) unit1301_SOURCES = unit1301.c $(UNITFILES)