compiled tests up to pp-func-traits template on msvc, gcc, clang, and wave

This commit is contained in:
Lorenzo Caminiti 2014-10-21 23:21:56 -07:00
parent 4e7e25ab0b
commit 41441cadf2
7 changed files with 44 additions and 10 deletions

3
.gitignore vendored
View File

@ -27,6 +27,9 @@
*.out
*.app
# VI
*.swp
# Boost.Jam outputs
bin/

View File

@ -14,14 +14,18 @@
#include <boost/preprocessor/list/at.hpp>
#include <boost/preprocessor/list/first_n.hpp>
// PRIVATE //
/* PRIVATE */
// Indirection needed for proper expansion (on MSVC).
#define BOOST_CONTRACT_EXT_PP_TRAITS_AUX_PARAMS_TRAITS_(sign_traits) \
BOOST_PP_TUPLE_ELEM(2, 1, sign_traits)
#define BOOST_CONTRACT_EXT_PP_TRAITS_AUX_PARAMS_REPLACE_LAST_DEFAULT_( \
s, sign, d, param_parse_macro, default_replace_macro, traits, last) \
BOOST_PP_LIST_APPEND_D(d, \
BOOST_PP_LIST_FIRST_N_D(d, last, traits), \
( \
BOOST_PP_TUPLE_ELEM(2, 1, \
BOOST_CONTRACT_EXT_PP_TRAITS_AUX_PARAMS_TRAITS_( \
default_replace_macro(d, s, \
( \
sign, \
@ -55,7 +59,7 @@
BOOST_PP_LIST_APPEND_D(d, \
traits, \
( \
BOOST_PP_TUPLE_ELEM(2, 1, \
BOOST_CONTRACT_EXT_PP_TRAITS_AUX_PARAMS_TRAITS_( \
param_parse_macro(d, s, \
( \
sign, \
@ -83,7 +87,7 @@
BOOST_PP_TUPLE_ELEM(4, 3, d_param_default_traits) \
)
// PUBLIC //
/* PUBLIC */
#define BOOST_CONTRACT_EXT_PP_TRAITS_AUX_PARAMS_D_S( \
d, s, sign, param_parse_macro, default_replace_macro) \

View File

@ -14,7 +14,8 @@
namespace boost { namespace contract { namespace test { namespace aux {
namespace pp_traits_ {
std::string remove_non_separation_spaces(std::string const& source) {
// Remove spaces not separating words, etc.
std::string trim ( std::string const& source ) {
std::locale locale;
std::string result = "";
for(std::string::size_type i = 0; i < source.size(); ++i) {
@ -36,16 +37,21 @@ std::string remove_non_separation_spaces(std::string const& source) {
} } } } } // namespace
// Indirections for proper expansion of BOOST_TEST generated error message.
#define BOOST_CONTRACT_TEST_AUX_PP_TRAITS_TEST_2ND_(pred) BOOST_TEST(pred);
#define BOOST_CONTRACT_TEST_AUX_PP_TRAITS_TEST_(pred) \
BOOST_CONTRACT_TEST_AUX_PP_TRAITS_TEST_2ND_(pred)
#define BOOST_CONTRACT_TEST_AUX_PP_TRAITS_EQUAL_(left, right) \
BOOST_TEST( \
boost::contract::test::aux::pp_traits_::remove_non_separation_spaces( \
BOOST_CONTRACT_TEST_AUX_PP_TRAITS_TEST_( \
boost::contract::test::aux::pp_traits_::trim( \
BOOST_CONTRACT_EXT_PP_STRINGIZE(left BOOST_PP_EMPTY()) \
) \
== \
boost::contract::test::aux::pp_traits_::remove_non_separation_spaces( \
boost::contract::test::aux::pp_traits_::trim( \
BOOST_CONTRACT_EXT_PP_STRINGIZE(right BOOST_PP_EMPTY()) \
) \
);
)
#define BOOST_CONTRACT_TEST_AUX_PP_TRAITS_( \
sign_traits, get_trait_macro, parsed_trait, sign_after_trait) \

View File

@ -4,5 +4,5 @@ import testing ;
run access.cpp ;
run verbatim.cpp ;
run export.cpp ;
exe template.cpp ;
run template.cpp ;

View File

@ -1,4 +1,9 @@
#include <boost/preprocessor/config/config.hpp>
#if !BOOST_PP_VARIADICS
# error "this compiler does not support variadic macros"
#else
#include <boost/contract/ext_/preprocessor/traits/func/aux_/index.hpp>
#define BOOST_CONTRACT_EXT_PP_FUNC_TRAITS_AUX_INDEX_TEST \
BOOST_CONTRACT_EXT_PP_FUNC_TRAITS_AUX_EXPORT_INDEX
@ -26,3 +31,5 @@ int main ( ) {
}
#endif // variadics

View File

@ -1,4 +1,9 @@
#include <boost/preprocessor/config/config.hpp>
#if !BOOST_PP_VARIADICS
# error "this compiler does not support variadic macros"
#else
#include <boost/contract/ext_/preprocessor/traits/func/aux_/index.hpp>
#define BOOST_CONTRACT_EXT_PP_FUNC_TRAITS_AUX_INDEX_TEST \
BOOST_CONTRACT_EXT_PP_FUNC_TRAITS_AUX_TEMPLATE_INDEX
@ -123,3 +128,5 @@ int main ( ) {
return BOOST_CONTRACT_TEST_AUX_PP_TRAITS_REPORT_ERRORS;
}
#endif // variadics

View File

@ -1,4 +1,9 @@
#include <boost/preprocessor/config/config.hpp>
#if !BOOST_PP_VARIADICS
# error "this compiler does not support variadic macros"
#else
#include <boost/contract/ext_/preprocessor/traits/func/aux_/index.hpp>
#define BOOST_CONTRACT_EXT_PP_FUNC_TRAITS_AUX_INDEX_TEST \
BOOST_CONTRACT_EXT_PP_FUNC_TRAITS_AUX_VERBATIM_INDEX
@ -51,3 +56,5 @@ int main ( ) {
return BOOST_CONTRACT_TEST_AUX_PP_TRAITS_REPORT_ERRORS;
}
#endif // variadics