object-introspection/test/integration/std_stack.toml
Alastair Robertson 2060a0491e CodeGen v2: Enable independent running without CodeGen v1
Create DrgnExporter to translate Type Graph "Type" nodes into drgn_type
structs, suitable for use in OICache and TreeBuilder.
2023-12-15 14:57:24 +00:00

115 lines
5.3 KiB
TOML

includes = ["stack", "vector"]
[cases]
[cases.int_empty]
oil_skip = 'not implemented for treebuilder v2' # https://github.com/facebookexperimental/object-introspection/issues/305
param_types = ["const std::stack<int>&"]
setup = "return {};"
expect_json = '''[{
"typeName": "std::stack<int32_t, std::deque<int32_t, std::allocator<int32_t>>>",
"staticSize": 80, "dynamicSize": 0, "length": 0, "capacity": 0, "elementStaticSize": 4,
"members": [
{
"typeName": "std::deque<int32_t, std::allocator<int32_t>>",
"staticSize": 80, "dynamicSize": 0, "length": 0, "capacity": 0, "elementStaticSize": 4
}
]}]'''
[cases.int_some]
oil_skip = 'not implemented for treebuilder v2' # https://github.com/facebookexperimental/object-introspection/issues/305
param_types = ["const std::stack<int>&"]
setup = "return std::stack<int>({1,2,3});"
expect_json = '''[{
"typeName": "std::stack<int32_t, std::deque<int32_t, std::allocator<int32_t>>>",
"staticSize": 80, "dynamicSize": 12, "length": 3, "capacity": 3, "elementStaticSize": 4,
"members": [
{
"typeName": "std::deque<int32_t, std::allocator<int32_t>>",
"staticSize": 80, "dynamicSize": 12, "length": 3, "capacity": 3, "elementStaticSize": 4
}
]}]'''
[cases.stack_int_empty]
oil_skip = 'not implemented for treebuilder v2' # https://github.com/facebookexperimental/object-introspection/issues/305
param_types = ["const std::stack<std::stack<int>>&"]
setup = "return {};"
expect_json = '''[{
"staticSize": 80, "dynamicSize": 0, "length": 0, "capacity": 0, "elementStaticSize": 80,
"members": [
{
"staticSize": 80, "dynamicSize": 0, "length": 0, "capacity": 0, "elementStaticSize": 80
}
]}]'''
[cases.stack_int_some]
oil_skip = 'not implemented for treebuilder v2' # https://github.com/facebookexperimental/object-introspection/issues/305
param_types = ["const std::stack<std::stack<int>>&"]
setup = '''
return std::stack<std::stack<int>>({
std::stack<int>({1,2,3}),
std::stack<int>(),
std::stack<int>({4,5})
});
'''
expect_json = '''[{
"staticSize": 80, "dynamicSize": 260, "length": 3, "capacity": 3, "elementStaticSize": 80,
"members": [
{
"staticSize": 80, "dynamicSize": 260, "length": 3, "capacity": 3, "elementStaticSize": 80,
"members": [
{
"typeName": "std::stack<int32_t, std::deque<int32_t, std::allocator<int32_t>>>",
"staticSize": 80, "dynamicSize": 12, "length": 3, "capacity": 3, "elementStaticSize": 4,
"members": [
{
"typeName": "std::deque<int32_t, std::allocator<int32_t>>",
"staticSize": 80, "dynamicSize": 12, "length": 3, "capacity": 3, "elementStaticSize": 4
}
]
},
{
"typeName": "std::stack<int32_t, std::deque<int32_t, std::allocator<int32_t>>>",
"staticSize": 80, "dynamicSize": 0, "length": 0, "capacity": 0, "elementStaticSize": 4,
"members": [
{
"typeName": "std::deque<int32_t, std::allocator<int32_t>>",
"staticSize": 80, "dynamicSize": 0, "length": 0, "capacity": 0, "elementStaticSize": 4
}
]
},
{
"typeName": "std::stack<int32_t, std::deque<int32_t, std::allocator<int32_t>>>",
"staticSize": 80, "dynamicSize": 8, "length": 2, "capacity": 2, "elementStaticSize": 4,
"members": [
{
"typeName": "std::deque<int32_t, std::allocator<int32_t>>",
"staticSize": 80, "dynamicSize": 8, "length": 2, "capacity": 2, "elementStaticSize": 4
}
]
}
]
}
]}]'''
[cases.adapter_vector_empty]
oil_skip = 'not implemented for treebuilder v2' # https://github.com/facebookexperimental/object-introspection/issues/305
param_types = ["const std::stack<int, std::vector<int>>&"]
setup = "return {};"
expect_json = '''[{
"typeName": "std::stack<int32_t, std::vector<int32_t, std::allocator<int32_t>>>",
"staticSize": 24, "dynamicSize": 0, "length": 0, "capacity": 0, "elementStaticSize": 4,
"members": [
{
"typeName": "std::vector<int32_t, std::allocator<int32_t>>",
"staticSize": 24, "dynamicSize": 0, "length": 0, "capacity": 0, "elementStaticSize": 4
}
]}]'''
[cases.adapter_vector_some]
oil_skip = 'not implemented for treebuilder v2' # https://github.com/facebookexperimental/object-introspection/issues/305
param_types = ["const std::stack<int, std::vector<int>>&"]
setup = "return std::stack<int, std::vector<int>>({1,2,3});"
expect_json = '''[{
"typeName": "std::stack<int32_t, std::vector<int32_t, std::allocator<int32_t>>>",
"staticSize": 24, "dynamicSize": 12, "length": 3, "capacity": 3, "elementStaticSize": 4,
"members": [
{
"typeName": "std::vector<int32_t, std::allocator<int32_t>>",
"staticSize": 24, "dynamicSize": 12, "length": 3, "capacity": 3, "elementStaticSize": 4
}
]}]'''