Add a configure switch to enable building of unit tests.

This commit is contained in:
Karol Nowak 2007-12-20 22:36:53 +00:00
parent 436a3c8655
commit a801497d8e
2 changed files with 21 additions and 0 deletions

View file

@ -79,6 +79,11 @@ else
CXXFLAGS="-O2 -W -Wall -ansi $CXXFLAGS"
fi
AC_ARG_ENABLE([tests],
AS_HELP_STRING([--enable-tests], [build unit tests]),
[tests=$enableval],
[tests=no])
AC_ARG_ENABLE([static],
AS_HELP_STRING([--enable-static], [enable static building of wesnoth]),
[static=$enableval],
@ -288,6 +293,7 @@ AM_CONDITIONAL([PYTHON_INSTALL], [test x$python_install = xyes])
AM_CONDITIONAL([GAME], [test x$game = xyes])
AM_CONDITIONAL([SERVER], [test x$server = xyes])
AM_CONDITIONAL([CAMPAIGNSERVER], [test x$campaignserver = xyes])
AM_CONDITIONAL([TESTS], [test x$tests = xyes])
AM_CONDITIONAL([EDITOR], [test x$editor = xyes])
AM_CONDITIONAL([USESVN], [test x$svnrev = xyes])
AM_CONDITIONAL([TOOLS], [test x$tools = xyes])

View file

@ -21,6 +21,10 @@ if CAMPAIGNSERVER
bin_PROGRAMS += campaignd
endif
if TESTS
bin_PROGRAMS += test
endif
CLEANFILES =
if TOOLS
@ -289,6 +293,17 @@ exploder_DEPENDENCIES=libwesnoth-core.a
cutter_LDADD = -L. -lwesnoth-core @SDL_IMAGE_LIBS@ @SDL_LIBS@ $(LIBINTL) $(PNG_LIBS)
cutter_DEPENDENCIES=libwesnoth-core.a
#############################################################################
# Castle building helpers #
#############################################################################
test_SOURCES = \
tests/main.cpp \
tests/test_util.cpp
test_LDADD = -L. -lwesnoth-core -lboost_unit_test_framework @SDL_IMAGE_LIBS@ @SDL_LIBS@ $(LIBINTL) $(PNG_LIBS)
test_DEPENDENCIES=libwesnoth-core.a
#############################################################################
# Headers
#############################################################################