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

Exclude build script by default #163

Merged
merged 1 commit into from
May 11, 2022
Merged

Exclude build script by default #163

merged 1 commit into from
May 11, 2022

Conversation

taiki-e
Copy link
Owner

@taiki-e taiki-e commented May 11, 2022

Closes #159

@taiki-e
Copy link
Owner Author

taiki-e commented May 11, 2022

bors r+

@bors
Copy link
Contributor

bors bot commented May 11, 2022

Build succeeded:

@bors bors bot merged commit 3a8b3e1 into main May 11, 2022
@bors bors bot deleted the build-script branch May 11, 2022 21:30
@taiki-e taiki-e added this to the v0.4 milestone May 11, 2022
@stouset
Copy link

stouset commented May 11, 2022

Does this actually remove the build_script_build module from coverage results? By my (potentially-inaccurate) reading it looks like it just adds a flag that lets you opt in or out, but the logic for actually excluding those results hasn't changed. So it looks like if you opt out you just end up with the same behavior as what happened previously, no?

@taiki-e
Copy link
Owner Author

taiki-e commented May 11, 2022

the logic for actually excluding those results hasn't changed

No. Changes to src/main.rs will change to ignore artifacts related to build scripts if --include-build-script flag is not passed.

if cx.cov.include_build_script {
    let dir = p.file_name().unwrap().to_string_lossy();
    if !cx.build_script_re.is_match(&dir) {
        return false;
    }
} else {
    // `false` means "ignore this path"
    return false;
}

If all corresponding artifacts are ignored, the file (and the module) will not be displayed in the report.

cov163

cov163-2

@taiki-e
Copy link
Owner Author

taiki-e commented May 12, 2022

Published in 0.4.0.

@stouset
Copy link

stouset commented May 12, 2022

I must have misunderstood the contents of the patch then. Thank you for the quick turnaround!

@stouset
Copy link

stouset commented May 15, 2022

Confirmed that this works as expected now. Thanks again!

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.

Exclude build.rs from coverage reports
2 participants