mirror of
https://github.com/JakeHillion/object-introspection.git
synced 2024-11-09 21:24:14 +00:00
2060a0491e
Create DrgnExporter to translate Type Graph "Type" nodes into drgn_type structs, suitable for use in OICache and TreeBuilder.
34 lines
1.8 KiB
TOML
34 lines
1.8 KiB
TOML
# This test checks that we can correctly distinguish between types with the same
|
|
# name in different namespaces.
|
|
includes = ["queue", "stack"]
|
|
definitions = '''
|
|
namespace nsA {
|
|
struct Foo {
|
|
int x;
|
|
};
|
|
} // namespace nsA
|
|
namespace nsB {
|
|
struct Foo {
|
|
int y;
|
|
int z;
|
|
};
|
|
} // namespace nsB
|
|
'''
|
|
[cases]
|
|
[cases.queue]
|
|
oil_skip = 'not implemented for treebuilder v2' # https://github.com/facebookexperimental/object-introspection/issues/308
|
|
param_types = ["const std::queue<std::pair<nsA::Foo, nsB::Foo>>&"]
|
|
setup = "return std::queue<std::pair<ns_namespaces::nsA::Foo, ns_namespaces::nsB::Foo>>({{ns_namespaces::nsA::Foo(), ns_namespaces::nsB::Foo()}});"
|
|
expect_json = '''[{
|
|
"typeName": "std::queue<std::pair<ns_namespaces::nsA::Foo, ns_namespaces::nsB::Foo>, std::deque<std::pair<ns_namespaces::nsA::Foo, ns_namespaces::nsB::Foo>, std::allocator<std::pair<ns_namespaces::nsA::Foo, ns_namespaces::nsB::Foo>>>>",
|
|
"staticSize": 80, "dynamicSize": 12, "length": 1, "capacity": 1, "elementStaticSize": 12
|
|
}]'''
|
|
[cases.stack]
|
|
oil_skip = 'not implemented for treebuilder v2' # https://github.com/facebookexperimental/object-introspection/issues/305
|
|
param_types = ["const std::stack<std::pair<nsA::Foo, nsB::Foo>>&"]
|
|
setup = "return std::stack<std::pair<ns_namespaces::nsA::Foo, ns_namespaces::nsB::Foo>>({{ns_namespaces::nsA::Foo(), ns_namespaces::nsB::Foo()}});"
|
|
expect_json = '''[{
|
|
"typeName": "std::stack<std::pair<ns_namespaces::nsA::Foo, ns_namespaces::nsB::Foo>, std::deque<std::pair<ns_namespaces::nsA::Foo, ns_namespaces::nsB::Foo>, std::allocator<std::pair<ns_namespaces::nsA::Foo, ns_namespaces::nsB::Foo>>>>",
|
|
"staticSize": 80, "dynamicSize": 12, "length": 1, "capacity": 1, "elementStaticSize": 12
|
|
}]'''
|