Skip to content

Commit

Permalink
updating test reference results
Browse files Browse the repository at this point in the history
  • Loading branch information
lyskov committed Dec 15, 2022
1 parent 61392fa commit e9b5598
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 138 deletions.
6 changes: 3 additions & 3 deletions source/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 + <space or tab> + 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;
}
}

Expand Down Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion source/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Config

private:
std::map<string, string> binders_, add_on_binders_;
std::map<string, string> binder_for_namespaces_, add_on_binder_for_namespaces_, custom_trampoline_function_;
std::map<string, string> binder_for_namespaces_, add_on_binder_for_namespaces_, custom_trampoline_functions_;

std::map<string, std::vector<string> > class_includes_, namespace_includes_;

Expand Down
20 changes: 0 additions & 20 deletions test/T42.stl.names.map.ref
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
// File: std/stl_function.cpp
#include <exception> // std::bad_exception
#include <exception> // std::exception
#include <exception> // std::terminate
#include <exception> // std::uncaught_exception
#include <exception> // std::unexpected
#include <functional> // std::binary_function
#include <functional> // std::equal_to
#include <functional> // std::less
#include <iterator> // __gnu_cxx::__normal_iterator
#include <memory> // std::allocator
#include <sstream> // __str__
Expand Down Expand Up @@ -56,32 +50,18 @@ void bind_std_stl_function(std::function< pybind11::module &(std::string const &
// File: std/functional_hash.cpp
#include <deque> // std::deque
#include <forward_list> // std::forward_list
#include <functional> // std::_Manager_operation
#include <functional> // std::bad_function_call
#include <functional> // std::hash
#include <functional> // std::less
#include <iterator> // __gnu_cxx::__normal_iterator
#include <list> // std::list
#include <map> // std::_Rb_tree_color
#include <map> // std::_Rb_tree_const_iterator
#include <map> // std::_Rb_tree_iterator
#include <map> // std::map
#include <memory> // std::allocator
#include <memory> // std::allocator_arg_t
#include <sstream> // __str__
#include <stdexcept> // std::domain_error
#include <stdexcept> // std::invalid_argument
#include <stdexcept> // std::length_error
#include <stdexcept> // std::logic_error
#include <stdexcept> // std::out_of_range
#include <stdexcept> // std::overflow_error
#include <stdexcept> // std::range_error
#include <stdexcept> // std::runtime_error
#include <stdexcept> // std::underflow_error
#include <string> // std::basic_string
#include <string> // std::char_traits
#include <string> // std::hash
#include <tuple> // std::tuple
#include <utility> // std::pair
#include <vector> // std::vector

Expand Down
27 changes: 0 additions & 27 deletions test/T42.stl.names.multi.ref
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
// File: std/stl_function.cpp
#include <deque> // std::deque
#include <forward_list> // std::forward_list
#include <functional> // std::binary_function
#include <functional> // std::equal_to
#include <functional> // std::less
#include <iterator> // __gnu_cxx::__normal_iterator
#include <list> // std::list
#include <memory> // std::allocator
#include <memory> // std::allocator_arg_t
#include <sstream> // __str__
#include <string> // std::basic_string
#include <string> // std::char_traits
#include <utility> // std::pair
#include <utility> // std::tuple_element
#include <vector> // std::vector

#include <functional>
#include <pybind11/pybind11.h>
Expand Down Expand Up @@ -58,33 +50,18 @@ void bind_std_stl_function(std::function< pybind11::module &(std::string const &
// File: std/functional_hash.cpp
#include <deque> // std::deque
#include <forward_list> // std::forward_list
#include <functional> // std::_Manager_operation
#include <functional> // std::bad_function_call
#include <functional> // std::hash
#include <functional> // std::less
#include <iterator> // __gnu_cxx::__normal_iterator
#include <list> // std::list
#include <map> // std::_Rb_tree_color
#include <map> // std::_Rb_tree_const_iterator
#include <map> // std::_Rb_tree_iterator
#include <map> // std::multimap
#include <memory> // std::allocator
#include <memory> // std::auto_ptr
#include <memory> // std::bad_weak_ptr
#include <sstream> // __str__
#include <stdexcept> // std::domain_error
#include <stdexcept> // std::invalid_argument
#include <stdexcept> // std::length_error
#include <stdexcept> // std::logic_error
#include <stdexcept> // std::out_of_range
#include <stdexcept> // std::overflow_error
#include <stdexcept> // std::range_error
#include <stdexcept> // std::runtime_error
#include <stdexcept> // std::underflow_error
#include <string> // std::basic_string
#include <string> // std::char_traits
#include <string> // std::hash
#include <tuple> // std::tuple
#include <utility> // std::pair
#include <vector> // std::vector

Expand Down Expand Up @@ -274,18 +251,14 @@ void bind_std_stl_multiset(std::function< pybind11::module &(std::string const &


// File: std/unordered_set.cpp
#include <deque> // std::deque
#include <forward_list> // std::forward_list
#include <functional> // std::equal_to
#include <functional> // std::hash
#include <list> // std::list
#include <memory> // std::allocator
#include <sstream> // __str__
#include <unordered_map> // std::__detail::_Node_const_iterator
#include <unordered_map> // std::__detail::_Node_iterator
#include <unordered_set> // std::unordered_multiset
#include <utility> // std::pair
#include <vector> // std::vector

#include <functional>
#include <pybind11/pybind11.h>
Expand Down
29 changes: 0 additions & 29 deletions test/T42.stl.names.multimap.ref
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
// File: std/stl_function.cpp
#include <deque> // std::deque
#include <forward_list> // std::forward_list
#include <functional> // std::binary_function
#include <functional> // std::equal_to
#include <functional> // std::less
#include <list> // std::list
#include <memory> // std::allocator
#include <memory> // std::allocator_arg_t
#include <sstream> // __str__
#include <string> // std::char_traits
#include <utility> // std::pair
#include <utility> // std::tuple_element
#include <vector> // std::vector

#include <functional>
#include <pybind11/pybind11.h>
Expand Down Expand Up @@ -44,33 +34,14 @@ void bind_std_stl_function(std::function< pybind11::module &(std::string const &
// File: std/functional_hash.cpp
#include <deque> // std::deque
#include <forward_list> // std::forward_list
#include <functional> // std::_Manager_operation
#include <functional> // std::bad_function_call
#include <functional> // std::hash
#include <functional> // std::less
#include <iterator> // __gnu_cxx::__normal_iterator
#include <list> // std::list
#include <map> // std::_Rb_tree_color
#include <map> // std::_Rb_tree_const_iterator
#include <map> // std::_Rb_tree_iterator
#include <map> // std::multimap
#include <memory> // std::allocator
#include <memory> // std::auto_ptr
#include <memory> // std::bad_weak_ptr
#include <sstream> // __str__
#include <stdexcept> // std::domain_error
#include <stdexcept> // std::invalid_argument
#include <stdexcept> // std::length_error
#include <stdexcept> // std::logic_error
#include <stdexcept> // std::out_of_range
#include <stdexcept> // std::overflow_error
#include <stdexcept> // std::range_error
#include <stdexcept> // std::runtime_error
#include <stdexcept> // std::underflow_error
#include <string> // std::basic_string
#include <string> // std::char_traits
#include <string> // std::hash
#include <tuple> // std::tuple
#include <utility> // std::pair
#include <vector> // std::vector

Expand Down
22 changes: 0 additions & 22 deletions test/T42.stl.names.multiset.ref
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
// File: std/stl_function.cpp
#include <functional> // std::binary_function
#include <functional> // std::equal_to
#include <functional> // std::less
#include <memory> // std::allocator_arg_t
#include <sstream> // __str__
#include <string> // std::char_traits

#include <functional>
#include <pybind11/pybind11.h>
Expand Down Expand Up @@ -35,32 +32,13 @@ void bind_std_stl_function(std::function< pybind11::module &(std::string const &


// File: std/functional_hash.cpp
#include <functional> // std::_Manager_operation
#include <functional> // std::bad_function_call
#include <functional> // std::equal_to
#include <functional> // std::hash
#include <functional> // std::less
#include <iterator> // __gnu_cxx::__normal_iterator
#include <map> // std::_Rb_tree_color
#include <map> // std::_Rb_tree_const_iterator
#include <memory> // std::allocator
#include <memory> // std::auto_ptr
#include <memory> // std::bad_weak_ptr
#include <set> // std::multiset
#include <sstream> // __str__
#include <stdexcept> // std::domain_error
#include <stdexcept> // std::invalid_argument
#include <stdexcept> // std::length_error
#include <stdexcept> // std::logic_error
#include <stdexcept> // std::out_of_range
#include <stdexcept> // std::overflow_error
#include <stdexcept> // std::range_error
#include <stdexcept> // std::runtime_error
#include <stdexcept> // std::underflow_error
#include <string> // std::basic_string
#include <string> // std::char_traits
#include <string> // std::hash
#include <tuple> // std::tuple
#include <unordered_map> // std::__detail::_Node_const_iterator
#include <unordered_map> // std::__detail::_Node_iterator
#include <unordered_set> // std::unordered_multiset
Expand Down
6 changes: 0 additions & 6 deletions test/T42.stl.names.ref
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
// File: std/stl_deque.cpp
#include <deque> // std::deque
#include <iterator> // __gnu_cxx::__normal_iterator
#include <memory> // std::allocator
#include <sstream> // __str__
#include <string> // std::basic_string
#include <string> // std::char_traits
#include <typeinfo> // std::bad_cast
#include <typeinfo> // std::bad_typeid
#include <typeinfo> // std::type_info

#include <functional>
#include <pybind11/pybind11.h>
Expand Down
29 changes: 0 additions & 29 deletions test/T42.stl.names.set.ref
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
// File: std/stl_function.cpp
#include <deque> // std::deque
#include <exception> // std::bad_exception
#include <exception> // std::exception
#include <exception> // std::terminate
#include <exception> // std::uncaught_exception
#include <exception> // std::unexpected
#include <forward_list> // std::forward_list
#include <functional> // std::binary_function
#include <functional> // std::equal_to
#include <functional> // std::less
#include <list> // std::list
#include <memory> // std::allocator
#include <sstream> // __str__
#include <vector> // std::vector

#include <functional>
#include <pybind11/pybind11.h>
Expand Down Expand Up @@ -45,31 +34,13 @@ void bind_std_stl_function(std::function< pybind11::module &(std::string const &
// File: std/functional_hash.cpp
#include <deque> // std::deque
#include <forward_list> // std::forward_list
#include <functional> // std::_Manager_operation
#include <functional> // std::bad_function_call
#include <functional> // std::hash
#include <functional> // std::less
#include <iterator> // __gnu_cxx::__normal_iterator
#include <list> // std::list
#include <map> // std::_Rb_tree_color
#include <map> // std::_Rb_tree_const_iterator
#include <memory> // std::allocator
#include <memory> // std::allocator_arg_t
#include <set> // std::set
#include <sstream> // __str__
#include <stdexcept> // std::domain_error
#include <stdexcept> // std::invalid_argument
#include <stdexcept> // std::length_error
#include <stdexcept> // std::logic_error
#include <stdexcept> // std::out_of_range
#include <stdexcept> // std::overflow_error
#include <stdexcept> // std::range_error
#include <stdexcept> // std::runtime_error
#include <stdexcept> // std::underflow_error
#include <string> // std::basic_string
#include <string> // std::char_traits
#include <string> // std::hash
#include <tuple> // std::tuple
#include <utility> // std::pair
#include <vector> // std::vector

Expand Down
34 changes: 33 additions & 1 deletion test/T70.options.ref
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,34 @@ void bind_T70_options_1(std::function< pybind11::module &(std::string const &nam
}


// File: T70_options_2.cpp
#include <T70.options.hpp> // aaaa::bbbb::BBBB
#include <T70.options.hpp> // aaaa::bbbb::foo_bbbb
#include <sstream> // __str__

#include <functional>
#include <pybind11/pybind11.h>
#include <string>

#ifndef BINDER_PYBIND11_TYPE_CASTER
#define BINDER_PYBIND11_TYPE_CASTER
PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>)
PYBIND11_DECLARE_HOLDER_TYPE(T, T*)
PYBIND11_MAKE_OPAQUE(std::shared_ptr<void>)
#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_<aaaa::bbbb::BBBB, std::shared_ptr<aaaa::bbbb::BBBB>> 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 <map>
#include <algorithm>
#include <functional>
Expand All @@ -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) {
Expand All @@ -101,6 +130,7 @@ PYBIND11_MODULE(T70_options, root_module) {

std::vector< std::pair<std::string, std::string> > 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() );
Expand All @@ -109,13 +139,15 @@ PYBIND11_MODULE(T70_options, root_module) {

bind_T70_options(M);
bind_T70_options_1(M);
bind_T70_options_2(M);

}

// Source list file: TEST/T70_options.sources
// 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

0 comments on commit e9b5598

Please sign in to comment.