From e9b55985af297ca161d615058e4a5da07c22bc77 Mon Sep 17 00:00:00 2001 From: Sergey Lyskov Date: Thu, 15 Dec 2022 15:55:59 -0700 Subject: [PATCH] updating test reference results --- source/config.cpp | 6 +++--- source/config.hpp | 2 +- test/T42.stl.names.map.ref | 20 ------------------- test/T42.stl.names.multi.ref | 27 -------------------------- test/T42.stl.names.multimap.ref | 29 ---------------------------- test/T42.stl.names.multiset.ref | 22 --------------------- test/T42.stl.names.ref | 6 ------ test/T42.stl.names.set.ref | 29 ---------------------------- test/T70.options.ref | 34 ++++++++++++++++++++++++++++++++- 9 files changed, 37 insertions(+), 138 deletions(-) diff --git a/source/config.cpp b/source/config.cpp index 022564d8..a7a056e9 100644 --- a/source/config.cpp +++ b/source/config.cpp @@ -214,7 +214,7 @@ void Config::read(string const &file_name) else if( token == _trampoline_member_function_binder_ ) { if( bind ) { auto member_function_name_and_function_name = split_in_two(name, "Invalid line for trampoline_member_function_binder specification! Must be: qualified_class_name::member_funtion_name + + name_of_function. Got: " + line); - custom_trampoline_function_[member_function_name_and_function_name.first] = member_function_name_and_function_name.second; + custom_trampoline_functions_[member_function_name_and_function_name.first] = member_function_name_and_function_name.second; } } @@ -356,8 +356,8 @@ bool Config::is_class_skipping_requested(string const &class__) const string Config::is_custom_trampoline_function_requested(string const &function_) const { - auto it = custom_trampoline_function_.find(function_); - if( it == custom_trampoline_function_.end() ) return ""; + auto it = custom_trampoline_functions_.find(function_); + if( it == custom_trampoline_functions_.end() ) return ""; else return it->second; } diff --git a/source/config.hpp b/source/config.hpp index 8adfb904..9f7b63d8 100644 --- a/source/config.hpp +++ b/source/config.hpp @@ -39,7 +39,7 @@ class Config private: std::map binders_, add_on_binders_; - std::map binder_for_namespaces_, add_on_binder_for_namespaces_, custom_trampoline_function_; + std::map binder_for_namespaces_, add_on_binder_for_namespaces_, custom_trampoline_functions_; std::map > class_includes_, namespace_includes_; diff --git a/test/T42.stl.names.map.ref b/test/T42.stl.names.map.ref index 4aa37fb2..5542aba8 100644 --- a/test/T42.stl.names.map.ref +++ b/test/T42.stl.names.map.ref @@ -1,12 +1,6 @@ // File: std/stl_function.cpp -#include // std::bad_exception -#include // std::exception -#include // std::terminate -#include // std::uncaught_exception -#include // std::unexpected #include // std::binary_function #include // std::equal_to -#include // std::less #include // __gnu_cxx::__normal_iterator #include // std::allocator #include // __str__ @@ -56,32 +50,18 @@ void bind_std_stl_function(std::function< pybind11::module &(std::string const & // File: std/functional_hash.cpp #include // std::deque #include // std::forward_list -#include // std::_Manager_operation -#include // std::bad_function_call #include // std::hash #include // std::less #include // __gnu_cxx::__normal_iterator #include // std::list -#include // std::_Rb_tree_color #include // std::_Rb_tree_const_iterator #include // std::_Rb_tree_iterator #include // std::map #include // std::allocator -#include // std::allocator_arg_t #include // __str__ -#include // std::domain_error -#include // std::invalid_argument -#include // std::length_error -#include // std::logic_error -#include // std::out_of_range -#include // std::overflow_error -#include // std::range_error -#include // std::runtime_error -#include // std::underflow_error #include // std::basic_string #include // std::char_traits #include // std::hash -#include // std::tuple #include // std::pair #include // std::vector diff --git a/test/T42.stl.names.multi.ref b/test/T42.stl.names.multi.ref index e72b83cb..d91ab560 100644 --- a/test/T42.stl.names.multi.ref +++ b/test/T42.stl.names.multi.ref @@ -1,19 +1,11 @@ // File: std/stl_function.cpp -#include // std::deque -#include // std::forward_list #include // std::binary_function #include // std::equal_to -#include // std::less #include // __gnu_cxx::__normal_iterator -#include // std::list #include // std::allocator -#include // std::allocator_arg_t #include // __str__ #include // std::basic_string #include // std::char_traits -#include // std::pair -#include // std::tuple_element -#include // std::vector #include #include @@ -58,33 +50,18 @@ void bind_std_stl_function(std::function< pybind11::module &(std::string const & // File: std/functional_hash.cpp #include // std::deque #include // std::forward_list -#include // std::_Manager_operation -#include // std::bad_function_call #include // std::hash #include // std::less #include // __gnu_cxx::__normal_iterator #include // std::list -#include // std::_Rb_tree_color #include // std::_Rb_tree_const_iterator #include // std::_Rb_tree_iterator #include // std::multimap #include // std::allocator -#include // std::auto_ptr -#include // std::bad_weak_ptr #include // __str__ -#include // std::domain_error -#include // std::invalid_argument -#include // std::length_error -#include // std::logic_error -#include // std::out_of_range -#include // std::overflow_error -#include // std::range_error -#include // std::runtime_error -#include // std::underflow_error #include // std::basic_string #include // std::char_traits #include // std::hash -#include // std::tuple #include // std::pair #include // std::vector @@ -274,18 +251,14 @@ void bind_std_stl_multiset(std::function< pybind11::module &(std::string const & // File: std/unordered_set.cpp -#include // std::deque -#include // std::forward_list #include // std::equal_to #include // std::hash -#include // std::list #include // std::allocator #include // __str__ #include // std::__detail::_Node_const_iterator #include // std::__detail::_Node_iterator #include // std::unordered_multiset #include // std::pair -#include // std::vector #include #include diff --git a/test/T42.stl.names.multimap.ref b/test/T42.stl.names.multimap.ref index fd7131ce..f0f7ea06 100644 --- a/test/T42.stl.names.multimap.ref +++ b/test/T42.stl.names.multimap.ref @@ -1,17 +1,7 @@ // File: std/stl_function.cpp -#include // std::deque -#include // std::forward_list #include // std::binary_function #include // std::equal_to -#include // std::less -#include // std::list -#include // std::allocator -#include // std::allocator_arg_t #include // __str__ -#include // std::char_traits -#include // std::pair -#include // std::tuple_element -#include // std::vector #include #include @@ -44,33 +34,14 @@ void bind_std_stl_function(std::function< pybind11::module &(std::string const & // File: std/functional_hash.cpp #include // std::deque #include // std::forward_list -#include // std::_Manager_operation -#include // std::bad_function_call #include // std::hash #include // std::less -#include // __gnu_cxx::__normal_iterator #include // std::list -#include // std::_Rb_tree_color #include // std::_Rb_tree_const_iterator #include // std::_Rb_tree_iterator #include // std::multimap #include // std::allocator -#include // std::auto_ptr -#include // std::bad_weak_ptr #include // __str__ -#include // std::domain_error -#include // std::invalid_argument -#include // std::length_error -#include // std::logic_error -#include // std::out_of_range -#include // std::overflow_error -#include // std::range_error -#include // std::runtime_error -#include // std::underflow_error -#include // std::basic_string -#include // std::char_traits -#include // std::hash -#include // std::tuple #include // std::pair #include // std::vector diff --git a/test/T42.stl.names.multiset.ref b/test/T42.stl.names.multiset.ref index 814791a2..f8a7e383 100644 --- a/test/T42.stl.names.multiset.ref +++ b/test/T42.stl.names.multiset.ref @@ -1,10 +1,7 @@ // File: std/stl_function.cpp #include // std::binary_function #include // std::equal_to -#include // std::less -#include // std::allocator_arg_t #include // __str__ -#include // std::char_traits #include #include @@ -35,32 +32,13 @@ void bind_std_stl_function(std::function< pybind11::module &(std::string const & // File: std/functional_hash.cpp -#include // std::_Manager_operation -#include // std::bad_function_call #include // std::equal_to #include // std::hash #include // std::less -#include // __gnu_cxx::__normal_iterator -#include // std::_Rb_tree_color #include // std::_Rb_tree_const_iterator #include // std::allocator -#include // std::auto_ptr -#include // std::bad_weak_ptr #include // std::multiset #include // __str__ -#include // std::domain_error -#include // std::invalid_argument -#include // std::length_error -#include // std::logic_error -#include // std::out_of_range -#include // std::overflow_error -#include // std::range_error -#include // std::runtime_error -#include // std::underflow_error -#include // std::basic_string -#include // std::char_traits -#include // std::hash -#include // std::tuple #include // std::__detail::_Node_const_iterator #include // std::__detail::_Node_iterator #include // std::unordered_multiset diff --git a/test/T42.stl.names.ref b/test/T42.stl.names.ref index bf674b75..aaf04705 100644 --- a/test/T42.stl.names.ref +++ b/test/T42.stl.names.ref @@ -1,13 +1,7 @@ // File: std/stl_deque.cpp #include // std::deque -#include // __gnu_cxx::__normal_iterator #include // std::allocator #include // __str__ -#include // std::basic_string -#include // std::char_traits -#include // std::bad_cast -#include // std::bad_typeid -#include // std::type_info #include #include diff --git a/test/T42.stl.names.set.ref b/test/T42.stl.names.set.ref index 783f796a..62a9cb3d 100644 --- a/test/T42.stl.names.set.ref +++ b/test/T42.stl.names.set.ref @@ -1,18 +1,7 @@ // File: std/stl_function.cpp -#include // std::deque -#include // std::bad_exception -#include // std::exception -#include // std::terminate -#include // std::uncaught_exception -#include // std::unexpected -#include // std::forward_list #include // std::binary_function #include // std::equal_to -#include // std::less -#include // std::list -#include // std::allocator #include // __str__ -#include // std::vector #include #include @@ -45,31 +34,13 @@ void bind_std_stl_function(std::function< pybind11::module &(std::string const & // File: std/functional_hash.cpp #include // std::deque #include // std::forward_list -#include // std::_Manager_operation -#include // std::bad_function_call #include // std::hash #include // std::less -#include // __gnu_cxx::__normal_iterator #include // std::list -#include // std::_Rb_tree_color #include // std::_Rb_tree_const_iterator #include // std::allocator -#include // std::allocator_arg_t #include // std::set #include // __str__ -#include // std::domain_error -#include // std::invalid_argument -#include // std::length_error -#include // std::logic_error -#include // std::out_of_range -#include // std::overflow_error -#include // std::range_error -#include // std::runtime_error -#include // std::underflow_error -#include // std::basic_string -#include // std::char_traits -#include // std::hash -#include // std::tuple #include // std::pair #include // std::vector diff --git a/test/T70.options.ref b/test/T70.options.ref index f9d98e4c..09470cfb 100644 --- a/test/T70.options.ref +++ b/test/T70.options.ref @@ -63,6 +63,34 @@ void bind_T70_options_1(std::function< pybind11::module &(std::string const &nam } +// File: T70_options_2.cpp +#include // aaaa::bbbb::BBBB +#include // aaaa::bbbb::foo_bbbb +#include // __str__ + +#include +#include +#include + +#ifndef BINDER_PYBIND11_TYPE_CASTER + #define BINDER_PYBIND11_TYPE_CASTER + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_MAKE_OPAQUE(std::shared_ptr) +#endif + +void bind_T70_options_2(std::function< pybind11::module &(std::string const &namespace_) > &M) +{ + { // aaaa::bbbb::BBBB file:T70.options.hpp line:28 + pybind11::class_> cl(M("aaaa::bbbb"), "BBBB", ""); + cl.def( pybind11::init( [](){ return new aaaa::bbbb::BBBB(); } ) ); + } + // aaaa::bbbb::foo_bbbb() file:T70.options.hpp line:29 + M("aaaa::bbbb").def("foo_bbbb", (void (*)()) &aaaa::bbbb::foo_bbbb, "C++: aaaa::bbbb::foo_bbbb() --> void"); + +} + + #include #include #include @@ -76,6 +104,7 @@ typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; void bind_T70_options(std::function< pybind11::module &(std::string const &namespace_) > &M); void bind_T70_options_1(std::function< pybind11::module &(std::string const &namespace_) > &M); +void bind_T70_options_2(std::function< pybind11::module &(std::string const &namespace_) > &M); PYBIND11_MODULE(T70_options, root_module) { @@ -101,6 +130,7 @@ PYBIND11_MODULE(T70_options, root_module) { std::vector< std::pair > sub_modules { {"", "aaaa"}, + {"aaaa", "bbbb"}, {"aaaa", "cccc"}, }; for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); @@ -109,6 +139,7 @@ PYBIND11_MODULE(T70_options, root_module) { bind_T70_options(M); bind_T70_options_1(M); + bind_T70_options_2(M); } @@ -116,6 +147,7 @@ PYBIND11_MODULE(T70_options, root_module) { // T70_options.cpp // T70_options.cpp // T70_options_1.cpp +// T70_options_2.cpp // Modules list file: TEST/T70_options.modules -// aaaa aaaa.cccc +// aaaa aaaa.bbbb aaaa.cccc