-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Magically improve coverage #6345
Merged
solana-grimes
merged 6 commits into
solana-labs:master
from
ryoqun:coverage-script-cleanup
Oct 16, 2019
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
cef3e6e
Delete old workaround and magically improve coverage
ryoqun a82a494
Restore workaround with updated comment; sadly still needed.
ryoqun 550918c
Separate for easier debugging; also forward args
ryoqun 98005bf
Redirect coverage stderr to file
ryoqun dba30e2
Compress right before uploading to save space
ryoqun ccafb52
Simplify
ryoqun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,13 +14,14 @@ reportName="lcov-${CI_COMMIT:0:9}" | |
|
||
if [[ -n $1 ]]; then | ||
crate="--package $1" | ||
shift | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To forward the rest to |
||
else | ||
crate="--all --exclude solana-local-cluster" | ||
fi | ||
|
||
coverageFlags=(-Zprofile) # Enable coverage | ||
coverageFlags+=("-Clink-dead-code") # Dead code should appear red in the report | ||
coverageFlags+=("-Ccodegen-units=1") # Disable ThinLTO which corrupts debuginfo (see [rustc issue #45511]). | ||
coverageFlags+=("-Ccodegen-units=1") # Disable code generation parallelism which is unsupported under -Zprofile (see [rustc issue #51705]). | ||
coverageFlags+=("-Cinline-threshold=0") # Disable inlining, which complicates control flow. | ||
coverageFlags+=("-Coverflow-checks=off") # Disable overflow checks, which create unnecessary branches. | ||
|
||
|
@@ -37,7 +38,9 @@ rm -rf target/cov/$reportName | |
|
||
source ci/rust-version.sh nightly | ||
# shellcheck disable=SC2086 # | ||
_ cargo +$rust_nightly test --target-dir target/cov --lib $crate | ||
RUST_LOG=solana=trace _ cargo +$rust_nightly test --target-dir target/cov --lib --no-run $crate "$@" | ||
# shellcheck disable=SC2086 # | ||
RUST_LOG=solana=trace _ cargo +$rust_nightly test --target-dir target/cov --lib $crate "$@" 2> target/cov/coverage-stderr.log | ||
|
||
echo "--- grcov" | ||
|
||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about this instead:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, It looks nicer; ccafb52.
Just that I'm too fond of redirections and pipes.. :p