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

Make `mach test-unit` not recompile components after `mach build` #21884

Merged
merged 1 commit into from Oct 7, 2018

Conversation

@SimonSapin
Copy link
Member

SimonSapin commented Oct 7, 2018

Previously, the tests feature flag of the embedder_traits crate caused it and every crate recursively depending on it to be built twice.

This feature flag was used to provide a specific set of "resources" when running tests. Instead, this commits overrides the main() function of the test harness to change resources at runtime before running any test.

This is done by adding a dependency that has name = "test" in its [lib] section of Cargo.toml. This overrides the crate found by extern crate test; in code generated by rustc --test.


This change is Reviewable

@highfive
Copy link

highfive commented Oct 7, 2018

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/Cargo.toml, components/constellation/Cargo.toml
  • @cbrewster: components/constellation/Cargo.toml
  • @paulrouget: components/servo/Cargo.toml, components/constellation/Cargo.toml, components/compositing/Cargo.toml
  • @KiChjang: components/net/Cargo.toml, components/script/Cargo.toml, components/script_traits/Cargo.toml, components/net_traits/Cargo.toml
@SimonSapin
Copy link
Member Author

SimonSapin commented Oct 7, 2018

Previously, the `tests` feature flag of the `embedder_traits` crate
caused it and every crate recursively depending on it to be built twice.

This feature flag was used to provide a specific set of "resources"
when running tests. Instead, this commits overrides the `main()` function
of the test harness to change resources at runtime before running any test.

This is done by adding a dependency that has `name = "test"` in its
`[lib]` section of `Cargo.toml`. This overrides the crate found by
`extern crate test;` in code generated by `rustc --test`.
@SimonSapin SimonSapin force-pushed the unit-rebuild branch from a0eaf75 to 1f7ebfc Oct 7, 2018
@emilio
Copy link
Member

emilio commented Oct 7, 2018

@bors-servo
Copy link
Contributor

bors-servo commented Oct 7, 2018

📌 Commit 1f7ebfc has been approved by emilio

@highfive highfive assigned emilio and unassigned paulrouget Oct 7, 2018
@bors-servo
Copy link
Contributor

bors-servo commented Oct 7, 2018

Testing commit 1f7ebfc with merge 87d32b3...

bors-servo added a commit that referenced this pull request Oct 7, 2018
Make `mach test-unit` not recompile components after `mach build`

Previously, the `tests` feature flag of the `embedder_traits` crate caused it and every crate recursively depending on it to be built twice.

This feature flag was used to provide a specific set of "resources" when running tests. Instead, this commits overrides the `main()` function of the test harness to change resources at runtime before running any test.

This is done by adding a dependency that has `name = "test"` in its `[lib]` section of `Cargo.toml`. This overrides the crate found by `extern crate test;` in code generated by `rustc --test`.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21884)
<!-- Reviewable:end -->
@emilio
emilio approved these changes Oct 7, 2018
@bors-servo
Copy link
Contributor

bors-servo commented Oct 7, 2018

@bors-servo bors-servo merged commit 1f7ebfc into master Oct 7, 2018
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@SimonSapin SimonSapin deleted the unit-rebuild branch Oct 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.