forked from boostorg/type_index
Log to std::cerr in ctti_print_name test and implicitly include ctti. Define BOOST_NO_RTTI for nortti test, so that even old compilers could compile tests
This commit is contained in:
@ -15,7 +15,7 @@ tlib = /boost/test//boost_unit_test_framework/<link>static ;
|
||||
compat = <define>BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY ;
|
||||
|
||||
# Making own `nortti` that is link compatible
|
||||
nortti = <toolset>gcc:<cxxflags>-fno-rtti <toolset>clang:<cxxflags>-fno-rtti <toolset>msvc:<cxxflags>/GR- ;
|
||||
nortti = <toolset>gcc:"<cxxflags>-fno-rtti -DBOOST_NO_RTTI" <toolset>clang:"<cxxflags>-fno-rtti -DBOOST_NO_RTTI" <toolset>msvc:<cxxflags>/GR- ;
|
||||
|
||||
|
||||
# Making libraries that CANNOT work between rtti-on/rtti-off modules
|
||||
|
@ -8,12 +8,13 @@
|
||||
#define BOOST_TEST_MODULE type_index_ctti_test_module
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
// This cpp file:
|
||||
// * tests BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING macro
|
||||
// * outputs full ctti name so that TypeIndex library could be adjust to new compiler without requesting regression tester's help
|
||||
#define BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING (0,0,false,"")
|
||||
#include <boost/type_index.hpp>
|
||||
#include <boost/type_index/ctti_type_index.hpp>
|
||||
|
||||
namespace user_defined_namespace {
|
||||
class user_defined_class {};
|
||||
@ -22,9 +23,9 @@ namespace user_defined_namespace {
|
||||
BOOST_AUTO_TEST_CASE(ctti_print_full_string_helper_test)
|
||||
{
|
||||
using namespace boost::typeindex;
|
||||
BOOST_TEST_CHECKPOINT("int: " << ctti_type_index::type_id<int>());
|
||||
BOOST_TEST_CHECKPOINT("double: " << ctti_type_index::type_id<double>());
|
||||
BOOST_TEST_CHECKPOINT("user_defined_namespace::user_defined_class: " << ctti_type_index::type_id<user_defined_namespace::user_defined_class>());
|
||||
std::cerr << "int: " << ctti_type_index::type_id<int>() << '\n';
|
||||
std::cerr << "double: " << ctti_type_index::type_id<double>() << '\n';
|
||||
std::cerr << "user_defined_namespace::user_defined_class: " << ctti_type_index::type_id<user_defined_namespace::user_defined_class>() << '\n';
|
||||
|
||||
BOOST_CHECK(true);
|
||||
}
|
||||
|
Reference in New Issue
Block a user