File tree Expand file tree Collapse file tree 3 files changed +33
-0
lines changed
Expand file tree Collapse file tree 3 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ endfunction()
3535
3636add_dependencies (build_tests ${PYWRAP} )
3737add_lib_unit_test(matrix)
38+ add_lib_unit_test(type_info)
3839add_lib_unit_test(multiple_registration)
3940if (BUILD_TESTING_SCIPY)
4041 find_scipy()
@@ -111,6 +112,7 @@ endif()
111112add_lib_unit_test(bind_virtual_factory)
112113
113114add_python_lib_unit_test("py-matrix" "unittest/python/test_matrix.py" )
115+ add_python_lib_unit_test("py-type-info" "unittest/python/test_type_info.py" )
114116add_python_lib_unit_test("py-multiple-registration"
115117 "unittest/python/test_multiple_registration.py" )
116118
Original file line number Diff line number Diff line change 1+ import type_info
2+
3+ d = type_info .Dummy ()
4+ assert d .type_info ().pretty_name () == "Dummy"
5+
6+ assert type_info .type_info (1 ).pretty_name () == "int"
7+ assert (
8+ type_info .type_info ("toto" ).pretty_name ()
9+ == "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>"
10+ )
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2024 INRIA
3+ */
4+
5+ #include < iostream>
6+
7+ #include " eigenpy/eigenpy.hpp"
8+ #include " eigenpy/type_info.hpp"
9+
10+ struct Dummy {};
11+
12+ BOOST_PYTHON_MODULE (type_info) {
13+ using namespace Eigen ;
14+ namespace bp = boost::python;
15+ eigenpy::enableEigenPy ();
16+
17+ eigenpy::expose_boost_type_info<int >();
18+ eigenpy::expose_boost_type_info<std::string>();
19+
20+ bp::class_<Dummy>(" Dummy" ).def (eigenpy::TypeInfoVisitor<Dummy>());
21+ }
You can’t perform that action at this time.
0 commit comments