C++11 testing moved to a configure option

Use './configure --enable-cpp11-testing' to enable the C++11 test.
Off by default for now.
This commit is contained in:
William S Fulton 2013-10-08 20:12:18 +01:00
commit de5e0c8655
3 changed files with 25 additions and 12 deletions

View file

@ -94,10 +94,8 @@ CPP_TEST_BROKEN += \
C_TEST_BROKEN += \
tag_no_clash_with_variable
# C++ test cases. (Can be run individually using: make testcase.cpptest)
CPP_TEST_CASES += \
$(CPP11_TEST_CASES) \
abstract_access \
abstract_inherit \
abstract_inherit_ok \
@ -541,6 +539,9 @@ ifndef SKIP_CPP_STD_CASES
CPP_TEST_CASES += ${CPP_STD_TEST_CASES}
endif
ifneq (,$(HAVE_CXX11_COMPILER))
CPP_TEST_CASES += $(CPP11_TEST_CASES)
endif
# C test cases. (Can be run individually using: make testcase.ctest)
C_TEST_CASES += \

View file

@ -22,6 +22,7 @@ TARGET = $(TARGET_NOEXE)@EXEEXT@
SOURCE = Source
CCACHE = CCache
DOCS = Doc/Manual
HAVE_CXX11_COMPILER = @HAVE_CXX11_COMPILER@
swig: libfiles source ccache
@ -240,7 +241,7 @@ check-%-test-suite:
echo warning: cannot $(ACTION) $* test-suite "(no dir $$dir)";\
else \
echo $(ACTION)ing $* test-suite; \
(cd $$dir && $(MAKE) -k -s $(ACTION)) \
(cd $$dir && $(MAKE) -k -s $(ACTION) HAVE_CXX11_COMPILER=$(HAVE_CXX11_COMPILER)) \
|| passed=false; \
fi; \
test $$passed = true

View file

@ -330,15 +330,26 @@ esac
AC_MSG_RESULT($PLATCFLAGS)
# Add switch if necessary to enable C++11 support - just for tests
AC_LANG_PUSH([C++])
CXXFLAGS_SAVED=$CXXFLAGS
AX_CXX_COMPILE_STDCXX_11([noext], [nostop])
CXXFLAGS=$CXXFLAGS_SAVED
AC_LANG_POP([C++])
if test x"$CXX11FLAGS" = x; then
PLATCXXFLAGS="$PLATCFLAGS"
else
PLATCXXFLAGS="$CXX11FLAGS $PLATCFLAGS"
AC_ARG_ENABLE([cpp11-testing], AS_HELP_STRING([--enable-cpp11-testing], [enable C++11 testing if supported by compiler (default disabled)]), [enable_cpp11_testing=$enableval], [enable_cpp11_testing=no])
AC_MSG_CHECKING([whether to enable C++11 testing])
AC_MSG_RESULT([$enable_cpp11_testing])
PLATCXXFLAGS="$PLATCFLAGS"
if test x"$enable_cpp11_testing" = xyes; then
AC_LANG_PUSH([C++])
CXXFLAGS_SAVED=$CXXFLAGS
AX_CXX_COMPILE_STDCXX_11([noext], [nostop])
CXXFLAGS=$CXXFLAGS_SAVED
AC_LANG_POP([C++])
if test x"$CXX11FLAGS" != x; then
PLATCXXFLAGS="$CXX11FLAGS $PLATCXXFLAGS"
fi
AC_MSG_CHECKING([for C++11 enabled compiler])
if test x"$HAVE_CXX11_COMPILER" = x; then
AC_MSG_RESULT([no])
else
AC_MSG_RESULT([$HAVE_CXX11_COMPILER])
fi
fi
# Set info about shared libraries.