-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Added code coverage support to Godot #36572
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
Thanks! |
skimmedsquare
added a commit
to skimmedsquare/godot
that referenced
this pull request
Oct 28, 2021
Based on godotengine#36572 which added support for Linux
akien-mga
added a commit
to akien-mga/godot
that referenced
this pull request
Aug 29, 2023
This would cause `updown.png` to be ignored in our default theme in 3.x. These ignores were added in godotengine#36800 for godotengine#36572 (see that PR for usage instructions). From a quick test, using `--output-file` for `lcov` and `--output-directory` for genhtml let us output the files in a way that won't conflict with the Git repository (e.g. in `bin/`, or outside the Git repo).
akien-mga
added a commit
to akien-mga/godot
that referenced
this pull request
Aug 29, 2023
This would cause `updown.png` to be ignored in our default theme in 3.x. These ignores were added in godotengine#36800 for godotengine#36572 (see that PR for usage instructions). From a quick test, using `--output-file` for `lcov` and `--output-directory` for genhtml let us output the files in a way that won't conflict with the Git repository (e.g. in `bin/`, or outside the Git repo). (cherry picked from commit 5c38e42)
akien-mga
added a commit
to akien-mga/godot
that referenced
this pull request
Sep 6, 2023
This would cause `updown.png` to be ignored in our default theme in 3.x. These ignores were added in godotengine#36800 for godotengine#36572 (see that PR for usage instructions). From a quick test, using `--output-file` for `lcov` and `--output-directory` for genhtml let us output the files in a way that won't conflict with the Git repository (e.g. in `bin/`, or outside the Git repo). (cherry picked from commit 5c38e42)
mandryskowski
pushed a commit
to mandryskowski/godot
that referenced
this pull request
Oct 11, 2023
This would cause `updown.png` to be ignored in our default theme in 3.x. These ignores were added in godotengine#36800 for godotengine#36572 (see that PR for usage instructions). From a quick test, using `--output-file` for `lcov` and `--output-directory` for genhtml let us output the files in a way that won't conflict with the Git repository (e.g. in `bin/`, or outside the Git repo).
YuriSizov
pushed a commit
to YuriSizov/godot
that referenced
this pull request
Jan 23, 2024
This would cause `updown.png` to be ignored in our default theme in 3.x. These ignores were added in godotengine#36800 for godotengine#36572 (see that PR for usage instructions). From a quick test, using `--output-file` for `lcov` and `--output-directory` for genhtml let us output the files in a way that won't conflict with the Git repository (e.g. in `bin/`, or outside the Git repo). (cherry picked from commit 5c38e42)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Code Coverage is a simple and easy method to find unreachable code and optimize functions which are called the most.
Required Tools
The only needed tools are(tested only on Linux, I'm not sure if macOS or Windows can run this):
gcc or clang
gcov
lcov
sudo apt install gcc gcov lcov clang
Usage
Go to Godot directory
cd ~/godot
Compile Godot with coverage support -
scons p=x11 -j6 use_coverage=yes
Run project/editor with compiled version of Godot etc. -
bin/godot.x11.tools.64 --path ~/Projekty/Godot-Project
Exit project
Run lcov capture command -
lcov --directory ./ --capture --output-file godot.info
Generate HTML -
genhtml godot.info --ignore-errors source
Run index.html from folder
to clear results execute
lcov --zerocounters
HTML file with code coverage of core/class_db.cpp when I runned The Worst Godot Project(remove .txt and open in browser) - lcov.html.txt
Report look like this: