From 61a2a6c46f5d6230a97770884414470afba60335 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Fri, 20 Jul 2012 16:33:48 -0500 Subject: [PATCH] tests: conditionally run optional tests if --enable-strict is not used (closes #25) --- configure.ac | 6 +++++- tests/{run.sh => run.sh.in} | 14 ++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) rename tests/{run.sh => run.sh.in} (92%) diff --git a/configure.ac b/configure.ac index a5fd1ef..28261de 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/tests/run.sh b/tests/run.sh.in similarity index 92% rename from tests/run.sh rename to tests/run.sh.in index 0cadf7a..f46babc 100644 --- a/tests/run.sh +++ b/tests/run.sh.in @@ -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