2
0
mirror of https://github.com/boostorg/lambda.git synced 2026-01-23 17:42:52 +00:00

Compare commits

...

2 Commits

Author SHA1 Message Date
Peter Dimov
95e1de198e Switch to LightweightTest to avoid deprecation warnings 2021-05-18 04:55:56 +03:00
Peter Dimov
86451f2238 Update test/Jamfile 2021-05-18 04:36:24 +03:00
20 changed files with 90 additions and 108 deletions

View File

@@ -10,26 +10,22 @@
import testing ; import testing ;
project run algorithm_test.cpp ;
: requirements <toolset>msvc:<asynch-exceptions>on run bind_tests_advanced.cpp ;
; run bind_tests_simple.cpp ;
run bind_tests_simple_f_refs.cpp ;
test-suite lambda run bll_and_function.cpp ;
: [ run algorithm_test.cpp ] run cast_test.cpp ;
[ run bind_tests_simple.cpp ] run constructor_tests.cpp ;
[ run bind_tests_advanced.cpp ] run control_structures.cpp ;
[ run bind_tests_simple_f_refs.cpp ] run exception_test.cpp ;
[ run bll_and_function.cpp ] run extending_rt_traits.cpp ;
[ run cast_test.cpp : : : : lambda_cast_test ] run is_instance_of_test.cpp ;
[ run constructor_tests.cpp ] run istreambuf_test.cpp ;
[ run control_structures.cpp ] run member_pointer_test.cpp ;
[ run exception_test.cpp ] run operator_tests_simple.cpp ;
[ run extending_rt_traits.cpp ] run phoenix_control_structures.cpp ;
[ run is_instance_of_test.cpp ] run result_of_tests.cpp ;
[ run member_pointer_test.cpp ] run ret_test.cpp ;
[ run operator_tests_simple.cpp ] run rvalue_test.cpp ;
[ run phoenix_control_structures.cpp ] run switch_construct.cpp ;
[ run switch_construct.cpp ]
[ run result_of_tests.cpp ]
[ run ret_test.cpp ]
;

View File

@@ -11,7 +11,8 @@
// test using BLL and boost::function // test using BLL and boost::function
#include <boost/test/minimal.hpp> // see "Header Implementation Option" #include <boost/core/lightweight_test.hpp>
#define BOOST_CHECK BOOST_TEST
#include "boost/lambda/lambda.hpp" #include "boost/lambda/lambda.hpp"
#include "boost/lambda/bind.hpp" #include "boost/lambda/bind.hpp"
@@ -46,15 +47,9 @@ void test_foreach() {
// More tests needed (for all algorithms) // More tests needed (for all algorithms)
int test_main(int, char *[]) { int main() {
test_foreach(); test_foreach();
return 0; return boost::report_errors();
} }

View File

@@ -13,7 +13,8 @@
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
#include <boost/test/minimal.hpp> // see "Header Implementation Option" #include <boost/core/lightweight_test.hpp>
#define BOOST_CHECK BOOST_TEST
#include "boost/lambda/lambda.hpp" #include "boost/lambda/lambda.hpp"
#include "boost/lambda/bind.hpp" #include "boost/lambda/bind.hpp"
@@ -413,7 +414,7 @@ void test_abstract()
BOOST_CHECK(bind(&base::foo, *_1)(&b) == 1); BOOST_CHECK(bind(&base::foo, *_1)(&b) == 1);
} }
int test_main(int, char *[]) { int main() {
test_nested_binds(); test_nested_binds();
test_unlambda(); test_unlambda();
@@ -424,5 +425,5 @@ int test_main(int, char *[]) {
test_break_const(); test_break_const();
test_sig(); test_sig();
test_abstract(); test_abstract();
return 0; return boost::report_errors();
} }

View File

@@ -12,7 +12,8 @@
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
#include <boost/test/minimal.hpp> // see "Header Implementation Option" #include <boost/core/lightweight_test.hpp>
#define BOOST_CHECK BOOST_TEST
#include "boost/lambda/bind.hpp" #include "boost/lambda/bind.hpp"
@@ -97,7 +98,7 @@ void test_data_members()
BOOST_CHECK(b.i == 1); BOOST_CHECK(b.i == 1);
} }
int test_main(int, char *[]) { int main() {
int i = 1; int j = 2; int k = 3; int i = 1; int j = 2; int k = 3;
int result; int result;
@@ -183,5 +184,5 @@ int test_main(int, char *[]) {
test_member_functions(); test_member_functions();
return 0; return boost::report_errors();
} }

View File

@@ -12,7 +12,8 @@
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
#include <boost/test/minimal.hpp> // see "Header Implementation Option" #include <boost/core/lightweight_test.hpp>
#define BOOST_CHECK BOOST_TEST
#include "boost/lambda/bind.hpp" #include "boost/lambda/bind.hpp"
@@ -57,7 +58,7 @@ void test_member_functions()
// bind(&A::add, a, _1); // bind(&A::add, a, _1);
} }
int test_main(int, char *[]) { int main() {
int i = 1; int j = 2; int k = 3; int i = 1; int j = 2; int k = 3;
int result; int result;
@@ -144,5 +145,5 @@ int test_main(int, char *[]) {
test_member_functions(); test_member_functions();
return 0; return boost::report_errors();
} }

View File

@@ -11,7 +11,8 @@
// test using BLL and boost::function // test using BLL and boost::function
#include <boost/test/minimal.hpp> // see "Header Implementation Option" #include <boost/core/lightweight_test.hpp>
#define BOOST_CHECK BOOST_TEST
#include "boost/lambda/lambda.hpp" #include "boost/lambda/lambda.hpp"
@@ -54,15 +55,9 @@ void test_function() {
} }
int test_main(int, char *[]) { int main() {
test_function(); test_function();
return 0; return boost::report_errors();
} }

View File

@@ -12,7 +12,8 @@
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
#include <boost/test/minimal.hpp> // see "Header Implementation Option" #include <boost/core/lightweight_test.hpp>
#define BOOST_CHECK BOOST_TEST
#include "boost/lambda/lambda.hpp" #include "boost/lambda/lambda.hpp"
@@ -100,8 +101,8 @@ void do_test() {
} }
int test_main(int, char *[]) { int main() {
do_test(); do_test();
return 0; return boost::report_errors();
} }

View File

@@ -12,7 +12,8 @@
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
#include <boost/test/minimal.hpp> // see "Header Implementation Option" #include <boost/core/lightweight_test.hpp>
#define BOOST_CHECK BOOST_TEST
#include "boost/lambda/lambda.hpp" #include "boost/lambda/lambda.hpp"
@@ -252,7 +253,7 @@ void delayed_construction()
bl::bind(constructor<std::pair<int, int> >(), _1, _2) ); bl::bind(constructor<std::pair<int, int> >(), _1, _2) );
} }
int test_main(int, char *[]) { int main() {
constructor_all_lengths(); constructor_all_lengths();
new_ptr_all_lengths(); new_ptr_all_lengths();
@@ -261,5 +262,5 @@ int test_main(int, char *[]) {
test_news_and_deletes(); test_news_and_deletes();
test_array_new_and_delete(); test_array_new_and_delete();
return 0; return boost::report_errors();
} }

View File

@@ -11,7 +11,8 @@
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
#include <boost/test/minimal.hpp> // see "Header Implementation Option" #include <boost/core/lightweight_test.hpp>
#define BOOST_CHECK BOOST_TEST
#include "boost/lambda/lambda.hpp" #include "boost/lambda/lambda.hpp"
#include "boost/lambda/if.hpp" #include "boost/lambda/if.hpp"
@@ -115,9 +116,9 @@ void simple_ifs () {
} }
int test_main(int, char *[]) int main()
{ {
simple_loops(); simple_loops();
simple_ifs(); simple_ifs();
return 0; return boost::report_errors();
} }

View File

@@ -11,7 +11,8 @@
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
#include <boost/test/minimal.hpp> // see "Header Implementation Option" #include <boost/core/lightweight_test.hpp>
#define BOOST_CHECK BOOST_TEST
#include "boost/lambda/lambda.hpp" #include "boost/lambda/lambda.hpp"
@@ -595,7 +596,7 @@ void return_type_matching() {
BOOST_CHECK(a == 'b'); BOOST_CHECK(a == 'b');
} }
int test_main(int, char *[]) { int main() {
try try
{ {
@@ -613,9 +614,5 @@ int test_main(int, char *[]) {
} }
return EXIT_SUCCESS; return boost::report_errors();
} }

View File

@@ -12,7 +12,8 @@
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
#include <boost/test/minimal.hpp> // see "Header Implementation Option" #include <boost/core/lightweight_test.hpp>
#define BOOST_CHECK BOOST_TEST
#include "boost/lambda/bind.hpp" #include "boost/lambda/bind.hpp"
#include "boost/lambda/lambda.hpp" #include "boost/lambda/lambda.hpp"
@@ -381,14 +382,8 @@ void test_binary_operators() {
} }
int test_main(int, char *[]) { int main() {
test_unary_operators(); test_unary_operators();
test_binary_operators(); test_binary_operators();
return 0; return boost::report_errors();
} }

View File

@@ -12,7 +12,8 @@
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
#include <boost/test/minimal.hpp> // see "Header Implementation Option" #include <boost/core/lightweight_test.hpp>
#define BOOST_CHECK BOOST_TEST
#include "boost/lambda/detail/is_instance_of.hpp" #include "boost/lambda/detail/is_instance_of.hpp"
@@ -45,7 +46,7 @@ template <bool b> class X {};
X<boost::lambda::is_instance_of_2<int, A2>::value> x; X<boost::lambda::is_instance_of_2<int, A2>::value> x;
int test_main(int, char *[]) { int main() {
using boost::lambda::is_instance_of_1; using boost::lambda::is_instance_of_1;
using boost::lambda::is_instance_of_2; using boost::lambda::is_instance_of_2;
@@ -73,7 +74,6 @@ BOOST_CHECK((is_instance_of_4<A4<int, float, char, double>, A4>::value == true))
BOOST_CHECK((is_instance_of_4<int, A4>::value == false)); BOOST_CHECK((is_instance_of_4<int, A4>::value == false));
BOOST_CHECK((is_instance_of_4<C4, A4>::value == false)); BOOST_CHECK((is_instance_of_4<C4, A4>::value == false));
return 0; return boost::report_errors();
} }

View File

@@ -7,7 +7,7 @@
// http://www.boost.org/LICENSE_1_0.txt // http://www.boost.org/LICENSE_1_0.txt
#include <boost/lambda/lambda.hpp> #include <boost/lambda/lambda.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
#include <iterator> #include <iterator>
#include <sstream> #include <sstream>
#include <algorithm> #include <algorithm>

View File

@@ -12,7 +12,8 @@
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
#include <boost/test/minimal.hpp> // see "Header Implementation Option" #include <boost/core/lightweight_test.hpp>
#define BOOST_CHECK BOOST_TEST
#include "boost/lambda/lambda.hpp" #include "boost/lambda/lambda.hpp"
@@ -182,11 +183,10 @@ void test_overloaded_pointer_to_member()
} }
int test_main(int, char *[]) { int main() {
pointer_to_data_member_tests(); pointer_to_data_member_tests();
pointer_to_member_function_tests(); pointer_to_member_function_tests();
test_overloaded_pointer_to_member(); test_overloaded_pointer_to_member();
return 0; return boost::report_errors();
} }

View File

@@ -13,7 +13,8 @@
#include <boost/test/minimal.hpp> // see "Header Implementation Option" #include <boost/core/lightweight_test.hpp>
#define BOOST_CHECK BOOST_TEST
#include "boost/lambda/lambda.hpp" #include "boost/lambda/lambda.hpp"
@@ -408,7 +409,7 @@ void pointer_arithmetic() {
} }
int test_main(int, char *[]) { int main() {
arithmetic_operators(); arithmetic_operators();
bitwise_operators(); bitwise_operators();
@@ -421,11 +422,5 @@ int test_main(int, char *[]) {
comma(); comma();
pointer_arithmetic(); pointer_arithmetic();
cout_tests(); cout_tests();
return 0; return boost::report_errors();
} }

View File

@@ -12,7 +12,8 @@
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
#include <boost/test/minimal.hpp> // see "Header Implementation Option" #include <boost/core/lightweight_test.hpp>
#define BOOST_CHECK BOOST_TEST
#include "boost/lambda/lambda.hpp" #include "boost/lambda/lambda.hpp"
#include "boost/lambda/if.hpp" #include "boost/lambda/if.hpp"
@@ -36,7 +37,7 @@ using namespace std;
// If-else, while, do-while, for statements // If-else, while, do-while, for statements
int test_main(int, char *[]) { int main() {
vector<int> v; vector<int> v;
v.clear(); v.clear();
@@ -143,6 +144,5 @@ int test_main(int, char *[]) {
v = t; v = t;
return 0; return boost::report_errors();
} }

View File

@@ -11,7 +11,9 @@
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
#include <boost/test/minimal.hpp> // see "Header Implementation Option" #include <boost/core/lightweight_test.hpp>
#define BOOST_CHECK BOOST_TEST
#include <boost/lambda/bind.hpp> #include <boost/lambda/bind.hpp>
#include <boost/lambda/lambda.hpp> #include <boost/lambda/lambda.hpp>
#include <boost/mpl/assert.hpp> #include <boost/mpl/assert.hpp>
@@ -252,7 +254,7 @@ typename boost::result_of<F(A, B, C)>::type apply3(F f, A a, B b, C c) {
using namespace boost::lambda; using namespace boost::lambda;
int test_main(int, char *[]) { int main() {
BOOST_CHECK(boost::lambda::bind(with_result_type())() == 0); BOOST_CHECK(boost::lambda::bind(with_result_type())() == 0);
BOOST_CHECK(boost::lambda::bind(with_result_type(), 1)() == 1); BOOST_CHECK(boost::lambda::bind(with_result_type(), 1)() == 1);
BOOST_CHECK(boost::lambda::bind(with_result_type(), 1, 2)() == 2); BOOST_CHECK(boost::lambda::bind(with_result_type(), 1, 2)() == 2);
@@ -311,5 +313,5 @@ int test_main(int, char *[]) {
BOOST_CHECK((apply3<int&, int&, int&>(_1 + _2 + _3, one, two, three) == 6)); BOOST_CHECK((apply3<int&, int&, int&>(_1 + _2 + _3, one, two, three) == 6));
BOOST_CHECK((apply3<const int&, const int&, const int&>(_1 + _2 + _3, one, two, three) == 6)); BOOST_CHECK((apply3<const int&, const int&, const int&>(_1 + _2 + _3, one, two, three) == 6));
return 0; return boost::report_errors();
} }

View File

@@ -8,7 +8,8 @@
// //
// For more information, see www.boost.org // For more information, see www.boost.org
#include <boost/test/minimal.hpp> #include <boost/core/lightweight_test.hpp>
#define BOOST_CHECK BOOST_TEST
#include <boost/lambda/lambda.hpp> #include <boost/lambda/lambda.hpp>
@@ -44,10 +45,10 @@ add_result operator+(addable, addable) {
return add_result(7); return add_result(7);
} }
int test_main(int, char*[]) { int main() {
addable test; addable test;
test_ret(add_result(7), boost::lambda::ret<add_result>(boost::lambda::_1 + test), test); test_ret(add_result(7), boost::lambda::ret<add_result>(boost::lambda::_1 + test), test);
test_ret(8.0, boost::lambda::ret<double>(boost::lambda::constant(7) + 1)); test_ret(8.0, boost::lambda::ret<double>(boost::lambda::constant(7) + 1));
return 0; return boost::report_errors();
} }

View File

@@ -7,7 +7,7 @@
// http://www.boost.org/LICENSE_1_0.txt // http://www.boost.org/LICENSE_1_0.txt
#include <boost/lambda/lambda.hpp> #include <boost/lambda/lambda.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
int main() int main()
{ {

View File

@@ -12,7 +12,8 @@
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
#include <boost/test/minimal.hpp> // see "Header Implementation Option" #include <boost/core/lightweight_test.hpp>
#define BOOST_CHECK BOOST_TEST
#include "boost/lambda/lambda.hpp" #include "boost/lambda/lambda.hpp"
@@ -379,14 +380,13 @@ void test_empty_cases() {
} }
int test_main(int, char* []) { int main() {
do_switch_no_defaults_tests(); do_switch_no_defaults_tests();
do_switch_yes_defaults_tests(); do_switch_yes_defaults_tests();
test_empty_cases(); test_empty_cases();
return EXIT_SUCCESS; return boost::report_errors();
} }