lw-build-system/scripts/build.tests.c++/build.tests

43 lines
980 B
Plaintext
Raw Normal View History

# These are external variables, and shouldn't clash with anything else
2006-08-09 11:16:18 +01:00
# @CNAME@_BUILT
#
build_target @TEST_LIBS@ || return 1
if [ -z ${@CNAME@_BUILT} ]
then
LIBS="@LINK_LIBS@"
EXTRAS="" # @TODO@ libs, cflags
echo "Building test programs..."
do_cmd mkdir -p obj/tests || return 1
2015-02-04 21:03:29 +00:00
for SRC in src/@NAME@/*.cc
do
2015-02-04 21:03:29 +00:00
TEST="obj/tests/$(basename ${SRC} | sed -e 's,.cc$,,')"
MODIFIED=0
for file in ${LIBS} ${SRC} src/@NAME@/build.tests
do
if [ ${file} -nt ${TEST} ]
then
MODIFIED=1
break
fi
done
if [ ${MODIFIED} -ne 0 ]
then
do_cmd ${CXX} -Iobj ${CFLAGS} -o ${TEST} ${SRC} ${LIBS} ${EXTRAS} || return 1
print_success "Built ${TEST}"
else
print_success "${TEST} is up to date"
fi
done
print_success "All tests built"
@CNAME@_BUILT=1
fi
2007-08-08 13:03:18 +01:00
# vim: syntax=sh:@VIM_MODELINE@