mirror of
https://github.com/boostorg/test.git
synced 2026-02-15 01:22:08 +00:00
C++03 compatibility
- Added guard for backward compatibility with C++03 - Narrowed runtime-param-test to C++11 (Jamfile) - Fixed name_params-test for C++03 compatibility (3 test case remain C++11 only)
This commit is contained in:
committed by
Raffi Enficiaud
parent
c40207eb98
commit
2255b7ea43
@@ -37,7 +37,7 @@ rule boost.test-self-test ( test-rule : test-suite : test-name : usage-variant ?
|
||||
|
||||
return [ $(test-rule) $(source_files) ../build//$(usage-variant) $(extra-libs)
|
||||
# gcov
|
||||
: #args
|
||||
: -- "" #args
|
||||
: $(pattern_file)
|
||||
: # Activating -pedantic finds more gotchas
|
||||
# Unfortunately, this warns about the use of "long long" in gcc's own stdlib
|
||||
@@ -46,7 +46,7 @@ rule boost.test-self-test ( test-rule : test-suite : test-name : usage-variant ?
|
||||
<toolset>gcc:<cxxflags>-Wno-long-long
|
||||
<toolset>gcc:<cxxflags>-Wno-variadic-macros
|
||||
<toolset>clang:<cxxflags>-Wno-c99-extensions
|
||||
# <toolset>gcc:<cxxflags>--coverage
|
||||
# <toolset>gcc:<cxxflags>--coverage
|
||||
<warnings>all
|
||||
$(extra-options)
|
||||
$(requirements)
|
||||
@@ -98,7 +98,7 @@ test-suite "utils-ts"
|
||||
[ boost.test-self-test run : utils-ts : class_properties-test ]
|
||||
[ boost.test-self-test run : utils-ts : foreach-test ]
|
||||
[ boost.test-self-test run : utils-ts : named_params-test ]
|
||||
[ boost.test-self-test run : utils-ts : runtime-param-test ]
|
||||
[ boost.test-self-test run : utils-ts : runtime-param-test : : : : : : [ requires cxx11_auto_declarations cxx11_function_template_default_args cxx11_lambdas cxx11_hdr_initializer_list ] ]
|
||||
[ boost.test-self-test run : utils-ts : string_cast-test ]
|
||||
[ boost.test-self-test run : utils-ts : token_iterator-test ]
|
||||
;
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
===========================
|
||||
log level: log_successful_tests; error type: no error;
|
||||
|
||||
160: Entering test case "error_on_demand"
|
||||
95: info: check 'no error' has passed
|
||||
164: Entering test case "error_on_demand"
|
||||
99: info: check 'no error' has passed
|
||||
Leaving test case "error_on_demand"
|
||||
|
||||
===========================
|
||||
log level: log_successful_tests; error type: user message;
|
||||
|
||||
160: Entering test case "error_on_demand"
|
||||
164: Entering test case "error_on_demand"
|
||||
message
|
||||
Test case error_on_demand did not check any assertions
|
||||
Leaving test case "error_on_demand"
|
||||
@@ -17,43 +17,43 @@ Leaving test case "error_on_demand"
|
||||
===========================
|
||||
log level: log_successful_tests; error type: user warning;
|
||||
|
||||
160: Entering test case "error_on_demand"
|
||||
103: warning: in "error_on_demand": warning
|
||||
164: Entering test case "error_on_demand"
|
||||
107: warning: in "error_on_demand": warning
|
||||
Test case error_on_demand did not check any assertions
|
||||
Leaving test case "error_on_demand"
|
||||
|
||||
===========================
|
||||
log level: log_successful_tests; error type: user non-fatal error;
|
||||
|
||||
160: Entering test case "error_on_demand"
|
||||
107: error: in "error_on_demand": non-fatal error
|
||||
164: Entering test case "error_on_demand"
|
||||
111: error: in "error_on_demand": non-fatal error
|
||||
Leaving test case "error_on_demand"
|
||||
|
||||
===========================
|
||||
log level: log_successful_tests; error type: cpp exception;
|
||||
|
||||
160: Entering test case "error_on_demand"
|
||||
164: Entering test case "error_on_demand"
|
||||
0: fatal error: in "error_on_demand": std::runtime_error: test std::runtime error what() message
|
||||
117: last checkpoint: error_on_demand() throw runtime_error
|
||||
121: last checkpoint: error_on_demand() throw runtime_error
|
||||
Leaving test case "error_on_demand"
|
||||
|
||||
===========================
|
||||
log level: log_successful_tests; error type: system error;
|
||||
|
||||
160: Entering test case "error_on_demand"
|
||||
111: fatal error: in "error_on_demand": fatal error
|
||||
164: Entering test case "error_on_demand"
|
||||
115: fatal error: in "error_on_demand": fatal error
|
||||
Leaving test case "error_on_demand"
|
||||
|
||||
===========================
|
||||
log level: log_test_suites; error type: no error;
|
||||
|
||||
160: Entering test case "error_on_demand"
|
||||
164: Entering test case "error_on_demand"
|
||||
Leaving test case "error_on_demand"
|
||||
|
||||
===========================
|
||||
log level: log_test_suites; error type: user message;
|
||||
|
||||
160: Entering test case "error_on_demand"
|
||||
164: Entering test case "error_on_demand"
|
||||
message
|
||||
Test case error_on_demand did not check any assertions
|
||||
Leaving test case "error_on_demand"
|
||||
@@ -61,31 +61,31 @@ Leaving test case "error_on_demand"
|
||||
===========================
|
||||
log level: log_test_suites; error type: user warning;
|
||||
|
||||
160: Entering test case "error_on_demand"
|
||||
103: warning: in "error_on_demand": warning
|
||||
164: Entering test case "error_on_demand"
|
||||
107: warning: in "error_on_demand": warning
|
||||
Test case error_on_demand did not check any assertions
|
||||
Leaving test case "error_on_demand"
|
||||
|
||||
===========================
|
||||
log level: log_test_suites; error type: user non-fatal error;
|
||||
|
||||
160: Entering test case "error_on_demand"
|
||||
107: error: in "error_on_demand": non-fatal error
|
||||
164: Entering test case "error_on_demand"
|
||||
111: error: in "error_on_demand": non-fatal error
|
||||
Leaving test case "error_on_demand"
|
||||
|
||||
===========================
|
||||
log level: log_test_suites; error type: cpp exception;
|
||||
|
||||
160: Entering test case "error_on_demand"
|
||||
164: Entering test case "error_on_demand"
|
||||
0: fatal error: in "error_on_demand": std::runtime_error: test std::runtime error what() message
|
||||
117: last checkpoint: error_on_demand() throw runtime_error
|
||||
121: last checkpoint: error_on_demand() throw runtime_error
|
||||
Leaving test case "error_on_demand"
|
||||
|
||||
===========================
|
||||
log level: log_test_suites; error type: system error;
|
||||
|
||||
160: Entering test case "error_on_demand"
|
||||
111: fatal error: in "error_on_demand": fatal error
|
||||
164: Entering test case "error_on_demand"
|
||||
115: fatal error: in "error_on_demand": fatal error
|
||||
Leaving test case "error_on_demand"
|
||||
|
||||
===========================
|
||||
@@ -101,24 +101,24 @@ Test case error_on_demand did not check any assertions
|
||||
===========================
|
||||
log level: log_messages; error type: user warning;
|
||||
|
||||
103: warning: in "error_on_demand": warning
|
||||
107: warning: in "error_on_demand": warning
|
||||
Test case error_on_demand did not check any assertions
|
||||
|
||||
===========================
|
||||
log level: log_messages; error type: user non-fatal error;
|
||||
|
||||
107: error: in "error_on_demand": non-fatal error
|
||||
111: error: in "error_on_demand": non-fatal error
|
||||
|
||||
===========================
|
||||
log level: log_messages; error type: cpp exception;
|
||||
|
||||
0: fatal error: in "error_on_demand": std::runtime_error: test std::runtime error what() message
|
||||
117: last checkpoint: error_on_demand() throw runtime_error
|
||||
121: last checkpoint: error_on_demand() throw runtime_error
|
||||
|
||||
===========================
|
||||
log level: log_messages; error type: system error;
|
||||
|
||||
111: fatal error: in "error_on_demand": fatal error
|
||||
115: fatal error: in "error_on_demand": fatal error
|
||||
|
||||
===========================
|
||||
log level: log_warnings; error type: no error;
|
||||
@@ -131,23 +131,23 @@ log level: log_warnings; error type: user message;
|
||||
===========================
|
||||
log level: log_warnings; error type: user warning;
|
||||
|
||||
103: warning: in "error_on_demand": warning
|
||||
107: warning: in "error_on_demand": warning
|
||||
|
||||
===========================
|
||||
log level: log_warnings; error type: user non-fatal error;
|
||||
|
||||
107: error: in "error_on_demand": non-fatal error
|
||||
111: error: in "error_on_demand": non-fatal error
|
||||
|
||||
===========================
|
||||
log level: log_warnings; error type: cpp exception;
|
||||
|
||||
0: fatal error: in "error_on_demand": std::runtime_error: test std::runtime error what() message
|
||||
117: last checkpoint: error_on_demand() throw runtime_error
|
||||
121: last checkpoint: error_on_demand() throw runtime_error
|
||||
|
||||
===========================
|
||||
log level: log_warnings; error type: system error;
|
||||
|
||||
111: fatal error: in "error_on_demand": fatal error
|
||||
115: fatal error: in "error_on_demand": fatal error
|
||||
|
||||
===========================
|
||||
log level: log_all_errors; error type: no error;
|
||||
@@ -164,18 +164,18 @@ log level: log_all_errors; error type: user warning;
|
||||
===========================
|
||||
log level: log_all_errors; error type: user non-fatal error;
|
||||
|
||||
107: error: in "error_on_demand": non-fatal error
|
||||
111: error: in "error_on_demand": non-fatal error
|
||||
|
||||
===========================
|
||||
log level: log_all_errors; error type: cpp exception;
|
||||
|
||||
0: fatal error: in "error_on_demand": std::runtime_error: test std::runtime error what() message
|
||||
117: last checkpoint: error_on_demand() throw runtime_error
|
||||
121: last checkpoint: error_on_demand() throw runtime_error
|
||||
|
||||
===========================
|
||||
log level: log_all_errors; error type: system error;
|
||||
|
||||
111: fatal error: in "error_on_demand": fatal error
|
||||
115: fatal error: in "error_on_demand": fatal error
|
||||
|
||||
===========================
|
||||
log level: log_cpp_exception_errors; error type: no error;
|
||||
@@ -197,12 +197,12 @@ log level: log_cpp_exception_errors; error type: user non-fatal error;
|
||||
log level: log_cpp_exception_errors; error type: cpp exception;
|
||||
|
||||
0: fatal error: in "error_on_demand": std::runtime_error: test std::runtime error what() message
|
||||
117: last checkpoint: error_on_demand() throw runtime_error
|
||||
121: last checkpoint: error_on_demand() throw runtime_error
|
||||
|
||||
===========================
|
||||
log level: log_cpp_exception_errors; error type: system error;
|
||||
|
||||
111: fatal error: in "error_on_demand": fatal error
|
||||
115: fatal error: in "error_on_demand": fatal error
|
||||
|
||||
===========================
|
||||
log level: log_system_errors; error type: no error;
|
||||
@@ -227,7 +227,7 @@ log level: log_system_errors; error type: cpp exception;
|
||||
===========================
|
||||
log level: log_system_errors; error type: system error;
|
||||
|
||||
111: fatal error: in "error_on_demand": fatal error
|
||||
115: fatal error: in "error_on_demand": fatal error
|
||||
|
||||
===========================
|
||||
log level: log_fatal_errors; error type: no error;
|
||||
@@ -252,7 +252,7 @@ log level: log_fatal_errors; error type: cpp exception;
|
||||
===========================
|
||||
log level: log_fatal_errors; error type: system error;
|
||||
|
||||
111: fatal error: in "error_on_demand": fatal error
|
||||
115: fatal error: in "error_on_demand": fatal error
|
||||
|
||||
===========================
|
||||
log level: log_nothing; error type: no error;
|
||||
|
||||
@@ -183,6 +183,11 @@ BOOST_AUTO_TEST_CASE( test_const_arg )
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
// the unit tests below assert functionality for non copyable classes, C++11 only
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) \
|
||||
&& !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS) \
|
||||
&& !defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS)
|
||||
|
||||
namespace test_mutable_arg {
|
||||
|
||||
nfp::typed_keyword<int, struct k1_t> k1;
|
||||
@@ -212,6 +217,7 @@ BOOST_AUTO_TEST_CASE( test_mutable_arg )
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
|
||||
namespace test_noncopyable_arg {
|
||||
|
||||
struct NC {
|
||||
@@ -240,6 +246,9 @@ BOOST_AUTO_TEST_CASE( test_noncopyable_arg )
|
||||
|
||||
} // test_noncopyable_arg
|
||||
|
||||
|
||||
#endif /* C++11 only */
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
namespace test_required_arg {
|
||||
@@ -378,7 +387,7 @@ nfp::typed_keyword<int, struct k2_t> k2;
|
||||
template<typename Params, typename T>
|
||||
void dotest0( Params const& p, T& targ )
|
||||
{
|
||||
targ = nfp::opt_get( p, k1, T{} );
|
||||
targ = nfp::opt_get( p, k1, T() );
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( test_optional_get )
|
||||
@@ -507,6 +516,10 @@ BOOST_AUTO_TEST_CASE( test_optional_append )
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) \
|
||||
&& !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS) \
|
||||
&& !defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS)
|
||||
|
||||
namespace test_no_params {
|
||||
|
||||
nfp::typed_keyword<int, struct k1_t> k1;
|
||||
@@ -524,3 +537,4 @@ BOOST_AUTO_TEST_CASE( test_no_params )
|
||||
}
|
||||
|
||||
} // test_no_params
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user