These represent types which don't store any interesting data for us to
measure, but which are required by a real container so can not be
replaced with our own generated class types.
std::allocator often has bad DWARF, so it must be replaced after the
DWARF is fixed up in Flattener. The others could be replaced earlier in
the transformation process if desired, but I've left them all together
for simplicity for now.
This fixes the folly::fbstring tests.
CTest can't forward command line arguments to the test runner, so add
the option to using an environment variable to enable features instead.
CMake issue tracking the feature that would have been needed:
https://gitlab.kitware.com/cmake/cmake/-/issues/20470
Tests which aren't passing yet have been disabled in CI.
We want to use the fully qualified name for scoped enums to keep the C++
compiler happy. When a parameter expects an enum value, we must supply
an enum value and not its underlying integer value.
Before:
isset_bitset<1, 0>
After:
isset_bitset<1, apache::thrift::detail::IssetBitsetOption::Unpacked>
Multi dimensional arrays are not flattened into 1-D arrays when using
TypeGraph. Update TreeBuilder to account for this.
By not flattening arrays, we are able to produce more descriptive
results.
The disadvantage is that we must now recurse inside arrays
containing only primitives. A better solution to requiring flattening
would be the planned work to not recurse into any static types (not just
primitives). This would also apply to multi-dimensional arrays of
primtivies.
When we were previously removing allocators, we were only able to work
with containers whose allocators appeared as their last template
parameter.
Now we can replace allocators in the middle of a parameter list.
This fixes tests for folly::sorted_vector_set.
This is necessary when replacing the allocator of a map type, for
example.
`std::map<int, int>` will need an allocator which allocates elements of
type `std::pair<const int, int>>`
std::basic_string takes three template parameters:
1. CharT
2. Traits
3. Allocator
The Traits parameter was causing issues, as it requires a type which
exposes certain things, e.g. `Traits::value_type`.
We have a few options to resolve this:
1. Remove this parameter, as we do for allocators
Cons: removing a template parameter doesn't work if other
parameters appear after it
2. Stub this parameter, as we do for hashers/comparators
Cons: we need to hardcode an implementation that satisfies the
`Traits::value_type` requirements
3. Leave the parameter as-is
Cons: will not work if a non-standard Traits is used
By using the real implementation of this Traits parameter
(normally `std::char_traits<CharT>`), we get one that we know will
work as long as it is defined in a stdlib header.
Option 3 is what we use in this patch. Instead of adding more
configuration options to the container TOML file format (e.g.
`params_to_keep = [1]`), we add `std::char_traits` as a dummy
container type. Now, whenever `std::char_traits` appears, it will be
left as-is, i.e. not removed, replaced or reverse-engineered.
This is the same approach previously used for Thrift's isset_bitset.
This fixes linker errors in debug builds.
When building in debug mode (-DCMAKE_BUILD_TYPE=Debug), folly requires
the function "safe_assert_terminate" to be defined. To avoid building
and linking against folly, we define our own no-op version of this
function.
uint64_t is a typedef. int is a primitive.
The cycles tests are going to be re-used to underpin some type-graph
unit tests. The patch removes unnecessary typedefs and makes the unit
tests simpler.
Previously, we treated weak_ptrs as normal types and we recursed
within them, following the internal data pointer and possibly causing
crashes. We really shouldn't be following them, so I added a custom
type to simply abort processing. If we want to handle them (ie: check
if they are valid, and follow them if so), that should be fairly easy
with the work there is here so far.
Instead of using an environment variable, pass the path to the config
file as a command line argument. This makes it possible to directly
copy the command being run (as show with --verbose) and run it in a
debugger outside of the test framework.
Old verbose output:
Running: /home/ajor/src/object-introspection3/build/test/integration/integration_test_target oil cycles_unique_ptr
New verbose output:
Running: /home/ajor/src/object-introspection3/build/test/integration/integration_test_target oil cycles_unique_ptr /home/ajor/src/object-introspection3/build/testing.oid.toml
these tests were skipped as they can't record the dynamic size. however,
there isn't a dynamic size to report as the type of the pointer is void.
accept a dynamic size of 0 as it's the best we can do with no type
knowledge.
The `oil_skip` test option was added for tests that don't work under OIL
but do work under OID. However, we now have two classes of `oil_skip`ped
tests: those that could be fixed, and those that will never work.
Increase clarity by not generating the tests which do not make sense at
all, leaving us with a cleaner set of skipped (and fixable) tests.