not-fl3 / macroquad

Cross-platform game engine in Rust.
Apache License 2.0
3.27k stars 317 forks source link

Fix all of the broken tests #744

Open cyrgani opened 3 months ago

cyrgani commented 3 months ago

This fixes the test failure described in #693 by wrapping the global Context in std::mem::ManuallyDrop to prevent the compiler from dropping it at the beginning of the second test when overwriting it. putting each test into its own file so they each get a fresh Context.

It also adds a missing reference to the doctest of the animation module to fix it and removes the failing doctest of text::Font::set_filter.

Fixes #693.

cyrgani commented 2 months ago

Marking this as a draft as it cannot fix the new error described in https://github.com/not-fl3/macroquad/issues/693#issuecomment-2225224880.

cyrgani commented 2 months ago

By putting each test function into its own file, they do not reuse any old statics and therefore they succeed. This should be ready to merge now @not-fl3.