Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify the structure of the tests #33

Closed
Tracked by #32
natecraddock opened this issue Dec 29, 2023 · 2 comments · Fixed by #46
Closed
Tracked by #32

Simplify the structure of the tests #33

natecraddock opened this issue Dec 29, 2023 · 2 comments · Fixed by #46
Labels
Milestone

Comments

@natecraddock
Copy link
Owner

Currently each version of Lua/Luau that Ziglua supports has tests and bindings for that version. This results in a lot of duplicated code (which isn't too bad because Lua is a stable target). But as time has gone on, this leads to a lot of duplicated effort in the following cases

  • making large updates to Ziglua, like documentation format
  • breaking changes in Zig versions

This is annoying enough that I think it is worth it to find a way to simplify things down to just one of each ziglua.zig and tests.zig files.

I attempted this in the past with usingnamespace "mixins", but it was really messy. I want to attempt this again, but this time using conditional compilation based on the target version of Lua.

@nurpax
Copy link
Contributor

nurpax commented Jan 10, 2024

I actually kind of liked how the different backends were duplicated. 🙂 It's very concrete that way. But I agree that it can be painful to keep all of these in sync. I think a very good first step would be to do this first for tests.zig. This will also nicely inform what might be missing from any of the different lib.zig versions.

@natecraddock
Copy link
Owner Author

natecraddock commented Jan 10, 2024

I actually kind of liked how the different backends were duplicated. 🙂 It's very concrete that way

I agree, and that is why I originally wrote the code this way. But as you said, keeping things in sync has become painful. So I'm experimenting with this idea. If it turns out to be more of a mess/hassle, then I will just keep the current duplicate code.

I think a very good first step would be to do this first for tests.zig. This will also nicely inform what might be missing from any of the different lib.zig versions.

I am starting work on this today, and I think this is a great suggestion, thank you!

Edit: started here #46

@natecraddock natecraddock linked a pull request Jan 11, 2024 that will close this issue
@natecraddock natecraddock changed the title Simplify the structure of the library Simplify the structure of the tests Jan 12, 2024
@natecraddock natecraddock added this to the 0.3.0 milestone Jan 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants