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 += \ C_TEST_BROKEN += \
tag_no_clash_with_variable tag_no_clash_with_variable
# C++ test cases. (Can be run individually using: make testcase.cpptest) # C++ test cases. (Can be run individually using: make testcase.cpptest)
CPP_TEST_CASES += \ CPP_TEST_CASES += \
$(CPP11_TEST_CASES) \
abstract_access \ abstract_access \
abstract_inherit \ abstract_inherit \
abstract_inherit_ok \ abstract_inherit_ok \
@ -541,6 +539,9 @@ ifndef SKIP_CPP_STD_CASES
CPP_TEST_CASES += ${CPP_STD_TEST_CASES} CPP_TEST_CASES += ${CPP_STD_TEST_CASES}
endif 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. (Can be run individually using: make testcase.ctest)
C_TEST_CASES += \ C_TEST_CASES += \

View file

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

View file

@ -330,15 +330,26 @@ esac
AC_MSG_RESULT($PLATCFLAGS) AC_MSG_RESULT($PLATCFLAGS)
# Add switch if necessary to enable C++11 support - just for tests # Add switch if necessary to enable C++11 support - just for tests
AC_LANG_PUSH([C++]) 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])
CXXFLAGS_SAVED=$CXXFLAGS AC_MSG_CHECKING([whether to enable C++11 testing])
AX_CXX_COMPILE_STDCXX_11([noext], [nostop]) AC_MSG_RESULT([$enable_cpp11_testing])
CXXFLAGS=$CXXFLAGS_SAVED
AC_LANG_POP([C++]) PLATCXXFLAGS="$PLATCFLAGS"
if test x"$CXX11FLAGS" = x; then if test x"$enable_cpp11_testing" = xyes; then
PLATCXXFLAGS="$PLATCFLAGS" AC_LANG_PUSH([C++])
else CXXFLAGS_SAVED=$CXXFLAGS
PLATCXXFLAGS="$CXX11FLAGS $PLATCFLAGS" 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 fi
# Set info about shared libraries. # Set info about shared libraries.