tests: conditionally run optional tests if --enable-strict is not used (closes #25)

pull/29/head
William Pitcock 2012-07-20 16:33:48 -05:00
parent 3035b0ba6b
commit 61a2a6c46f
2 changed files with 13 additions and 7 deletions

View File

@ -13,10 +13,14 @@ AC_CACHE_CHECK([whether to enable strict mode],
if test "x$ac_cv_use_strict" = "xyes"; then
AC_DEFINE([HAVE_STRICT_MODE], [1], [Define if strict mode is requested.])
STRICT_MODE=yes
else
AC_DEFINE([HAVE_STRICT_MODE], [0], [Define if strict mode is requested.])
STRICT_MODE=no
fi
AC_SUBST([STRICT_MODE])
AC_PROG_CPP
AC_PROG_CC
AC_PROG_INSTALL
@ -26,5 +30,5 @@ BUILDSYS_SHARED_LIB
BUILDSYS_PROG_IMPLIB
BUILDSYS_TOUCH_DEPS
AC_CONFIG_FILES([buildsys.mk])
AC_CONFIG_FILES([buildsys.mk tests/run.sh])
AC_OUTPUT

View File

@ -127,12 +127,14 @@ run_test "PKG_CONFIG_PATH=${selfdir}/lib1 ${1} --max-version 2.0 'foo '; echo \$
'0'
# 10) tests for internal getopt implementation with options at the end
run_test "PKG_CONFIG_PATH=${selfdir}/lib1 ${1} foo --libs" \
'-lfoo'
run_test "PKG_CONFIG_PATH=${selfdir}/lib1 ${1} foo --cflags --libs" \
'-lfoo' '-I/usr/include/foo' '-fPIC'
run_test "PKG_CONFIG_PATH=${selfdir}/lib1 ${1} --cflags foo --libs" \
'-lfoo' '-I/usr/include/foo' '-fPIC'
if [ "x@STRICT_MODE@" == "xno" ]; then
run_test "PKG_CONFIG_PATH=${selfdir}/lib1 ${1} foo --libs" \
'-lfoo'
run_test "PKG_CONFIG_PATH=${selfdir}/lib1 ${1} foo --cflags --libs" \
'-lfoo' '-I/usr/include/foo' '-fPIC'
run_test "PKG_CONFIG_PATH=${selfdir}/lib1 ${1} --cflags foo --libs" \
'-lfoo' '-I/usr/include/foo' '-fPIC'
fi
if [ ${failed} -gt 0 ]; then
echo "${failed} of ${done} tests failed. See output for details." >&2