Commit Graph

17 Commits

Author SHA1 Message Date
Jake Hillion
4975b6e9fa test: add features field to integration tests
Previously we tested different feature flags by using the `cli_options` field
in the test `.toml`. This works for OID but doesn't work for JIT OIL and won't
work for AoT OIL when those tests get added.

This change adds a new higher level `features` field to the test `.toml` which
adds the features to the config file as a prefix. This works with all methods
of generation.

Change the existing `cli_options` features to `features` except for where
they're testing something specific. Enable tests that were previously disabled
for OIL but only didn't work because of not being able to enable features.
Change pointer tests that are currently broken for OIL from `oil_disable` to
`oil_skip` - they can work, but codegen is broken for them at the minute.

Test plan:
- CI
- `make test` is no worse
2024-01-16 16:23:21 +00:00
Jake Hillion
71e734b120 tbv2: calculate total memory footprint
Add the option to calculate total size (inclusive size) by wrapping the
existing iterator. This change provides a new iterator, `SizedIterator`, which
wraps an existing iterator and adds a new field `size` to the output element.

This is achieved with a two pass algorithm on the existing iterator:
1. Gather metadata for each element. This includes the total size up until that
   element and the range of elements that should be included in the size.
2. Return the result from the underlying iterator with the additional
   field.

This algorithm is `O(N)` time on the number of elements in the iterator and
`O(N)` time, storing 16 bytes per element. This isn't super expensive but is a
lot more than the current algorithm which requires close to constant space.
Because of this I've implemented it as a wrapper on the iterator rather than on
by default, though it is now on in every one of our integration test cases.

Test plan:
- Added to the integration tests for full coverage.
2024-01-04 09:21:35 +00:00
Jake Hillion
37991140da support 0 to many config files (#371)
Summary:
Previously OID/OIL required exactly one configuration file. This change makes it so you can supply 0 or more configuration files. 0 is useful if you have pre-generated the cache or use some sort of remote generation system. 1 is useful for the common case, where you have a configuration file that describes your entire source and use just that. More are useful if you have supplemental bits of config you wish to apply/override - see the changes to the integration test framework where we do exactly this.


Test Plan:
This isn't super well tested. It works for the test cases which add features via the config or enable `codegen.ignore`.

- CI

Reviewed By: ajor

Differential Revision: D49758032

Pulled By: JakeHillion
2023-10-02 14:06:39 -06:00
Jake Hillion
5071519e45 oil v2 2023-08-23 15:59:53 +01:00
Alastair Robertson
cd836bad62 Integration tests: Assume dynamicSize of 0 in OIL tests if it is not set
This just makes it a little easier to write tests for purely static
types.
2023-05-24 15:42:26 +01:00
Alastair Robertson
939256030c Integration test: Add "target_function" option 2023-05-18 14:34:08 +01:00
Jake Hillion
641a128b39 add command line feature addition/removal 2023-04-21 19:02:44 +02:00
Alastair Robertson
fb58ccebac Integration tests: Have target process print its pid
This makes it easier to work with when running multiple instances of it
manually, outside of the integration testing framework.
2023-03-28 16:42:14 +01:00
Alastair Robertson
512163f98e Integration tests: Pass config to OIL tests on the command line
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
2023-03-22 16:57:35 +00:00
Jake Hillion
c4194a9fbc oil: remove fields in options 2023-03-20 16:26:10 +00:00
Jake Hillion
06aa3e3d40 clear all warnings and enable -Werror 2023-03-20 11:14:55 +00:00
Alastair Robertson
5dd92b7f7f Integration tests: Test arrays 2023-03-09 11:51:41 +00:00
Jake Hillion
be273f6e0d tests: make relative config paths absolute when copying 2023-02-28 15:13:48 -08:00
Jake Hillion
ee56decc10 oil: change interface to references 2023-01-31 13:30:58 +00:00
Alastair Robertson
7c1b4c2a43 Integration test readme: Add example of how to run a single test
Also minor cleanup of gen_tests.py
2023-01-26 12:11:21 +00:00
Jake Hillion
358b4e9505 add oil_disable test option
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.
2023-01-04 17:56:37 +00:00
Jon Haslam
db90326c4b Initial commit 2022-12-19 06:37:51 -08:00