Make better use of Catch2v3 modularity in unit test code
In #828 I did a quick hack to enable support for Catch2 version 3.0+, since our macOS CI was failing after Homebrew upgraded.
The hack achieves basic parity with Catch2 version 2, but the real promise of Catch2 v3 is to enable faster testrunner builds and more efficient unit testing by only incorporating the parts of it that we actually need. If we can get away with using only catch_test_macros.hpp, the Catch project reports that it's five times cheaper than including all of catch.hpp from v2.
There are some other nice features that might be worth using, iff they're also available in the older Catch2 v2 versions as well. (It's too soon for our tests to require Catch2 v3+ exclusively. #ThanksUbuntuLTS)
For example, the Catch2::literals namespace defines a literal for Approx values:
// Instead of writing this
CHECK(clip.Duration() == Approx(31.0).margin(0.01));
// We can just write (allowing Approx to pick a sensible default margin)...
using namespace Catch2::literals;
CHECK(clip.Duration() == 31.0_a);
Now that we're building with C++14 support as a requirement, we can take advantage of user-defined literals where available.
It's worth investigating what improvements can be made to our unit tests, in terms of both code and build configuration.
Thank you so much for submitting an issue to help improve OpenShot Video Editor. We are sorry about this, but this particular issue has gone unnoticed for quite some time. To help keep the OpenShot GitHub Issue Tracker organized and focused, we must ensure that every issue is correctly labelled and triaged, to get the proper attention.
This issue will be closed, as it meets the following criteria:
- No activity in the past 90 days
- No one is assigned to this issue
We'd like to ask you to help us out and determine whether this issue should be reopened.
- If this issue is reporting a bug, please can you attempt to reproduce on the latest daily build to help us to understand whether the bug still needs our attention.
- If this issue is proposing a new feature, please can you verify whether the feature proposal is still relevant.
Thanks again for your help!