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

Reorganize tests into public/internal #762

Merged
merged 6 commits into from
Mar 15, 2023

Conversation

isaacbrodsky
Copy link
Collaborator

Reorganizes tests into public and internal categories. The intention is that the public part of the tests should be runnable even when the internal library functions are not available (for example, on Windows, or using HydroniumLabs/h3o). This is not possible today in this PR because there are still some internal functions that are used in various parts of tests.

This PR is intended to only reorganize the tests - there should not be any coverage change or meaningful change to the test suite (or library for that matter).

I'd suggest a combination or replacing function calls with constants or data files (since the data file tests are easiest to port to different bindings or implementations), and when it really helps the test suite, marking some functions as exported for tests. These functions would not be part of the public API for versioning purposes and are not intended to be called by applications, but would be exposed by the library. An example would be setH3Index.

Also included in this PR is a new CMake option AUDIT_SOURCE_FILE_LIST, which is used in CI to ensure the file lists in CMakeLists.txt actually match what's in the repository.

@coveralls
Copy link

coveralls commented Mar 11, 2023

Coverage Status

Coverage: 98.657%. Remained the same when pulling c57087f on isaacbrodsky:reorg-internal-tests into f0336b5 on uber:master.

@isaacbrodsky
Copy link
Collaborator Author

Coverage Status

Coverage: 98.227% (-0.4%) from 98.657% when pulling e9532a7 on isaacbrodsky:reorg-internal-tests into f0336b5 on uber:master.

Coverage decreasing probably means a test got dropped somewhere in the refactor.

@@ -22,19 +22,6 @@
#include "vertex.h"

SUITE(Vertex) {
TEST(directionForVertexNum_badVerts) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Was this test deleted accidentally?

#include "vertex.h"

SUITE(Vertex) {
TEST(vertexNumForDirection_hex) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@dfellis this should be where the test you commented on moved to?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Got it.

Copy link
Collaborator

@nrabinowitz nrabinowitz left a comment

Choose a reason for hiding this comment

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

LGTM

#include "test.h"
#include "utility.h"

SUITE(h3ToLocalIj) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: Doesn't much matter, but should these have the -Internal suffix in the suite name?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We can -- although maybe we should just use a macro like __FILE__ or an extension macro like __FILE_NAME__ instead.

@isaacbrodsky isaacbrodsky merged commit b6c9085 into uber:master Mar 15, 2023
@isaacbrodsky isaacbrodsky deleted the reorg-internal-tests branch March 15, 2023 20:01
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.

4 participants