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

Use doctest instead of Catch2 for tests #1064

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Use doctest instead of Catch2 for tests #1064

wants to merge 4 commits into from

Conversation

azrogers
Copy link
Contributor

Closes #69. We've been intending for quite a while to switch to doctest for tests instead of our current test framework, Catch2. Not only is doctest the test framework that other Cesium projects use, but the compile times are also quite a bit faster. It would be good to get this out of the way while we have the chance - as @kring mentioned, it will only get more difficult as time goes on.

@azrogers
Copy link
Contributor Author

I'll note that while the point of this is mostly to improve test build times, the test builds seem slower on CI. Subjectively, they're faster on my machine now, so maybe this is just an artifact of doctest not yet being cached? Not sure. A larger sample size is probably needed.

@kring
Copy link
Member

kring commented Jan 16, 2025

the test builds seem slower on CI

cesium-native aggressively uses ccache on CI, so it won't even compile source files at all if they don't change. It makes our CI builds really fast, but also makes it impossible to compare build performance on CI. So I wouldn't worry about that, but if you have any doubts about the local performance actually improving, it might be worth doing a quick measurement just to make sure.

Copy link
Member

@kring kring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this @azrogers! Minor comments...

@@ -15,6 +13,24 @@
#include <string>
#include <vector>

using namespace doctest;

bool compareVectors(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be in the anonymous namespace. Or maybe moved to CesiumNativeTests?


#include <bitset>
#include <climits>
#include <cstddef>
#include <cstring>
#include <ostream>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this header needed?

@@ -21,13 +21,14 @@
#include <glm/fwd.hpp>

#include <cstdint>
#include <ostream>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why ostream is needed here, either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Evaluate doctest instead of Catch2 for unit tests
2 participants