2
0
mirror of https://github.com/boostorg/lambda.git synced 2026-01-26 06:32:23 +00:00

Compare commits

..

2 Commits

Author SHA1 Message Date
Peter Dimov
016b12959b Add a Focal libc++ configuration 2021-05-18 05:29:36 +03:00
Peter Dimov
ca87d33f3d Disable UBSan on libc++ configuration; Clang 7 fails with a link error 2021-05-18 05:18:49 +03:00
21 changed files with 117 additions and 90 deletions

View File

@@ -132,6 +132,15 @@ matrix:
- os: linux - os: linux
dist: bionic dist: bionic
compiler: clang++-libc++ compiler: clang++-libc++
env: TOOLSET=clang CXXSTD=03,11,14,17,2a
addons:
apt:
packages:
- libc++-dev
- os: linux
dist: focal
compiler: clang++-libc++
env: UBSAN=1 TOOLSET=clang CXXSTD=03,11,14,17,2a UBSAN_OPTIONS=print_stacktrace=1 env: UBSAN=1 TOOLSET=clang CXXSTD=03,11,14,17,2a UBSAN_OPTIONS=print_stacktrace=1
addons: addons:
apt: apt:

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -12,8 +12,7 @@
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
#include <boost/core/lightweight_test.hpp> #include <boost/test/minimal.hpp> // see "Header Implementation Option"
#define BOOST_CHECK BOOST_TEST
#include "boost/lambda/detail/is_instance_of.hpp" #include "boost/lambda/detail/is_instance_of.hpp"
@@ -46,7 +45,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 main() { int test_main(int, char *[]) {
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;
@@ -74,6 +73,7 @@ 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 boost::report_errors(); return 0;
} }

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/core/lightweight_test.hpp> #include <boost/detail/lightweight_test.hpp>
#include <iterator> #include <iterator>
#include <sstream> #include <sstream>
#include <algorithm> #include <algorithm>

View File

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

View File

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

View File

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

View File

@@ -11,9 +11,7 @@
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
#include <boost/core/lightweight_test.hpp> #include <boost/test/minimal.hpp> // see "Header Implementation Option"
#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>
@@ -254,7 +252,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 main() { int test_main(int, char *[]) {
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);
@@ -313,5 +311,5 @@ int main() {
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 boost::report_errors(); return 0;
} }

View File

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

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/core/lightweight_test.hpp> #include <boost/detail/lightweight_test.hpp>
int main() int main()
{ {

View File

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