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

feature/tap-sh
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 if test "x$ac_cv_use_strict" = "xyes"; then
AC_DEFINE([HAVE_STRICT_MODE], [1], [Define if strict mode is requested.]) AC_DEFINE([HAVE_STRICT_MODE], [1], [Define if strict mode is requested.])
STRICT_MODE=yes
else else
AC_DEFINE([HAVE_STRICT_MODE], [0], [Define if strict mode is requested.]) AC_DEFINE([HAVE_STRICT_MODE], [0], [Define if strict mode is requested.])
STRICT_MODE=no
fi fi
AC_SUBST([STRICT_MODE])
AC_PROG_CPP AC_PROG_CPP
AC_PROG_CC AC_PROG_CC
AC_PROG_INSTALL AC_PROG_INSTALL
@ -26,5 +30,5 @@ BUILDSYS_SHARED_LIB
BUILDSYS_PROG_IMPLIB BUILDSYS_PROG_IMPLIB
BUILDSYS_TOUCH_DEPS BUILDSYS_TOUCH_DEPS
AC_CONFIG_FILES([buildsys.mk]) AC_CONFIG_FILES([buildsys.mk tests/run.sh])
AC_OUTPUT AC_OUTPUT

View File

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