-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Only init game if we're running tests that need it #70901
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
Code: Tests
Measurement, self-control, statistics, balancing.
[C++]
Changes (can be) made in C++. Previously named `Code`
Code: Infrastructure / Style / Static Analysis
Code internal infrastructure and style
json-styled
JSON lint passed, label assigned by github actions
labels
Jan 13, 2024
github-actions
bot
added
the
astyled
astyled PR, label is assigned by github actions
label
Jan 13, 2024
github-actions
bot
added
BasicBuildPassed
This PR builds correctly, label assigned by github actions
and removed
BasicBuildPassed
This PR builds correctly, label assigned by github actions
labels
Jan 13, 2024
github-actions
bot
added
the
BasicBuildPassed
This PR builds correctly, label assigned by github actions
label
Jan 14, 2024
Qrox
reviewed
Jan 14, 2024
github-actions
bot
removed
the
astyled
astyled PR, label is assigned by github actions
label
Jan 14, 2024
github-actions
bot
added
the
astyled
astyled PR, label is assigned by github actions
label
Jan 14, 2024
This broke CI for mods. CI runs the test binary with all mods loaded but no tests selected ( |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
astyled
astyled PR, label is assigned by github actions
BasicBuildPassed
This PR builds correctly, label assigned by github actions
[C++]
Changes (can be) made in C++. Previously named `Code`
Code: Infrastructure / Style / Static Analysis
Code internal infrastructure and style
Code: Tests
Measurement, self-control, statistics, balancing.
json-styled
JSON lint passed, label assigned by github actions
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Infrastructure "Only init game if we're running tests that need it"
Purpose of change
Implement the long-staning
TODO
intests/test_main.cpp
with the same name.Describe the solution
The idea is to tag those few
TEST_CASE()
s with the special[nogame]
tag. This is checked before running the tests by looping over all the selected tests. If all have[nogame]
, then the global game object is not called.This speeds up some kind of tests a lot by not initializing the game.
Describe alternatives you've considered
Use a tag
[g]
to do the opposite. But this would have required to review all the 1139 tests.Testing
[utility]
do not initialized the game objectAdditional context
More tests should be reviewed and tagged as
[nogame]
.