build: fold test makefile into primary makefile
Moving the subdir makefile into the main one lets us more easily track dependencies for reliable builds. Previously we tended to build against old versions of the static library when running the tests.
This commit is contained in:
parent
331f185160
commit
ecc40f2315
55
Makefile.am
55
Makefile.am
@ -5,8 +5,6 @@ ACLOCAL_AMFLAGS = -I m4
|
|||||||
|
|
||||||
AM_CXXFLAGS = $(BOOST_CPPFLAGS) $(ZLIB_CFLAGS)
|
AM_CXXFLAGS = $(BOOST_CPPFLAGS) $(ZLIB_CFLAGS)
|
||||||
|
|
||||||
SUBDIRS = test
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
## Source definitions
|
## Source definitions
|
||||||
|
|
||||||
@ -209,7 +207,6 @@ libutil_a_CXXFLAGS = $(AM_CXXFLAGS)
|
|||||||
AM_DEFAULT_SOURCE_EXT = .cpp
|
AM_DEFAULT_SOURCE_EXT = .cpp
|
||||||
|
|
||||||
AM_LDFLAGS = $(BOOST_LDFLAGS)
|
AM_LDFLAGS = $(BOOST_LDFLAGS)
|
||||||
LDADD = $(top_builddir)/libutil.a $(BOOST_FILESYSTEM_LIB) $(BOOST_SYSTEM_LIB) $(ZLIB_LIBS)
|
|
||||||
|
|
||||||
bin_PROGRAMS = \
|
bin_PROGRAMS = \
|
||||||
tools/hash \
|
tools/hash \
|
||||||
@ -217,4 +214,54 @@ bin_PROGRAMS = \
|
|||||||
tools/json-validate \
|
tools/json-validate \
|
||||||
tools/json-schema
|
tools/json-schema
|
||||||
|
|
||||||
tools_hash_LDADD = $(top_builddir)/libutil.a $(BOOST_FILESYSTEM_LIB) $(BOOST_SYSTEM_LIB) $(ZLIB_LIBS)
|
LDADD = $(top_builddir)/libutil.a $(BOOST_FILESYSTEM_LIB) $(BOOST_SYSTEM_LIB) $(ZLIB_LIBS)
|
||||||
|
|
||||||
|
|
||||||
|
##-----------------------------------------------------------------------------
|
||||||
|
## Tests
|
||||||
|
|
||||||
|
AM_LDFLAGS += $(BOOST_LDFLAGS) $(BOOST_FILESYSTEM_LIB) $(BOOST_SYSTEM_LIB)
|
||||||
|
AM_CXXFLAGS += -I$(top_srcdir)
|
||||||
|
|
||||||
|
TEST_BIN = \
|
||||||
|
test/backtrace \
|
||||||
|
test/bezier \
|
||||||
|
test/bitwise \
|
||||||
|
test/checksum \
|
||||||
|
test/colour \
|
||||||
|
test/extent \
|
||||||
|
test/fixed \
|
||||||
|
test/float \
|
||||||
|
test/hton \
|
||||||
|
test/ip \
|
||||||
|
test/json_types \
|
||||||
|
test/maths \
|
||||||
|
test/maths_matrix \
|
||||||
|
test/matrix \
|
||||||
|
test/md2 \
|
||||||
|
test/md4 \
|
||||||
|
test/md5 \
|
||||||
|
test/options \
|
||||||
|
test/point \
|
||||||
|
test/polynomial \
|
||||||
|
test/pool \
|
||||||
|
test/rand \
|
||||||
|
test/range \
|
||||||
|
test/region \
|
||||||
|
test/ripemd \
|
||||||
|
test/sha1 \
|
||||||
|
test/sha2 \
|
||||||
|
test/signal \
|
||||||
|
test/stringid \
|
||||||
|
test/uri \
|
||||||
|
test/version
|
||||||
|
|
||||||
|
|
||||||
|
if PLATFORM_WIN32
|
||||||
|
test_hton_LDFLAGS = -lws2_32
|
||||||
|
endif
|
||||||
|
|
||||||
|
TEST_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/build-aux/tap-driver.sh
|
||||||
|
TESTS = $(top_builddir)/test/static.test $(top_builddir)/test/json.test
|
||||||
|
check_PROGRAMS = $(TEST_BIN)
|
||||||
|
EXTRA_DIST += static.test json.test json
|
||||||
|
@ -109,4 +109,5 @@ AC_CONFIG_FILES([
|
|||||||
test/Makefile
|
test/Makefile
|
||||||
])
|
])
|
||||||
AC_CONFIG_FILES([test/json.test], [chmod a+x test/json.test])
|
AC_CONFIG_FILES([test/json.test], [chmod a+x test/json.test])
|
||||||
|
AC_CONFIG_FILES([test/static.test], [chmod a+x test/static.test])
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
@ -1,47 +0,0 @@
|
|||||||
AM_LDFLAGS = $(COMMON_LDFLAGS) $(BOOST_LDFLAGS) $(BOOST_FILESYSTEM_LIB) $(BOOST_SYSTEM_LIB)
|
|
||||||
AM_CXXFLAGS = $(COMMON_CXXFLAGS) -I$(top_srcdir)
|
|
||||||
|
|
||||||
TEST_BIN = \
|
|
||||||
backtrace \
|
|
||||||
bezier \
|
|
||||||
bitwise \
|
|
||||||
checksum \
|
|
||||||
colour \
|
|
||||||
extent \
|
|
||||||
fixed \
|
|
||||||
float \
|
|
||||||
hton \
|
|
||||||
ip \
|
|
||||||
json_types \
|
|
||||||
maths \
|
|
||||||
maths_matrix \
|
|
||||||
matrix \
|
|
||||||
md2 \
|
|
||||||
md4 \
|
|
||||||
md5 \
|
|
||||||
options \
|
|
||||||
point \
|
|
||||||
polynomial \
|
|
||||||
pool \
|
|
||||||
rand \
|
|
||||||
range \
|
|
||||||
region \
|
|
||||||
ripemd \
|
|
||||||
sha1 \
|
|
||||||
sha2 \
|
|
||||||
signal \
|
|
||||||
stringid \
|
|
||||||
uri \
|
|
||||||
version
|
|
||||||
|
|
||||||
AM_DEFAULT_SOURCE_EXT = .cpp
|
|
||||||
LDADD = $(builddir)/../libutil.a
|
|
||||||
|
|
||||||
if PLATFORM_WIN32
|
|
||||||
hton_LDFLAGS = -lws2_32
|
|
||||||
endif
|
|
||||||
|
|
||||||
TEST_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/build-aux/tap-driver.sh
|
|
||||||
TESTS = static.test json.test
|
|
||||||
check_PROGRAMS = $(TEST_BIN)
|
|
||||||
EXTRA_DIST = static.test json.test json
|
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
tests=($(find . -type f -executable | grep -v test))
|
tests=($(find "@abs_top_builddir@/test/" -type f -executable | grep -v ".test$"))
|
||||||
|
|
||||||
echo 1..$((${#tests[@]}))
|
echo 1..$((${#tests[@]}))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user