Limit-Theory-Redux / ltheory

Limit Theory Redux is a fork of the discontinued open-world space simulation game Limit Theory. We have made it our mission to continue the development of the ambitious Limit Theory project as an open source initiative.
Apache License 2.0
62 stars 8 forks source link

Refactor TypeInfo into a variant in luajit-ffi-gen #326

Closed dgavedissian closed 3 months ago

dgavedissian commented 3 months ago

This makes it far more explicit when we handle plain types vs options vs boxes etc. I think this structure also makes sense as not all types (box, functions, etc) support refs.

I used the opportunity to massively increase our test coverage for luajit-ffi-gen. My goal was to attempt to cover almost all cases in the tests.

I also added the ability to configure the location of the Lua FFI code generation, which allowed me to actually generate and commit the Lua FFI code for the unit test structs. Obviously, this code is not used in the game itself, but it does mean that we can see the ffi_gen and ffi_meta files for all possible cases without relying on the game code itself.

dgavedissian commented 3 months ago

When I initially implemented this, I was too tired (and lazy :P ) to add more test

I completely understand :D it was a struggle to write tests here too, but I was afraid to accidentally break something without adding them first.