tests: run the C++ tests on all the available standards

This is much of course more efficient than in the matrix of the CI (or
on our own machines), but a bit more tedious.

* configure.ac (CXX03_CXXFLAGS, CXX11_CXXFLAGS, CXX14_CXXFLAGS)
(CXX17_CXXFLAGS, CXX2A_CXXFLAGS, STDCXX_FLAGS): New.
* tests/atlocal.in: Receive them.
* tests/local.at (AT_FOR_EACH_CXX): New.
* tests/c++.at: Use AT_FOR_EACH_CXX.
This commit is contained in:
Akim Demaille
2018-09-12 22:01:32 +02:00
parent 84744e5f63
commit 9ff76cdda8
4 changed files with 40 additions and 7 deletions

View File

@@ -54,7 +54,14 @@ AC_PROG_CC_STDC
AC_PROG_CXX
AC_LANG_PUSH([C++])
gl_WARN_ADD([-fno-exceptions], [NO_EXCEPTIONS_CXXFLAGS])
gl_WARN_ADD([-std=c++98], [CXX98_CXXFLAGS])
gl_WARN_ADD([-std=c++03], [CXX03_CXXFLAGS])
gl_WARN_ADD([-std=c++11], [CXX11_CXXFLAGS])
gl_WARN_ADD([-std=c++14], [CXX14_CXXFLAGS])
gl_WARN_ADD([-std=c++17], [CXX17_CXXFLAGS])
gl_WARN_ADD([-std=c++2a], [CXX2A_CXXFLAGS])
AC_SUBST([STDCXX_FLAGS],
["$CXX98_CXXFLAGS $CXX03_CXXFLAGS $CXX11_CXXFLAGS $CXX14_CXXFLAGS $CXX17_CXXFLAGS $CXX2A_CXXFLAGS "])
AM_CONDITIONAL([ENABLE_CXX11], [test x"$CXX11_CXXFLAGS" != x])
AC_LANG_POP([C++])