Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upWrite a python script to generate type assertions for Servo_* functions #13598
Labels
Comments
|
Please make a comment here if you intend to work on this issue. Thank you! |
|
Is this what you want? #13603 |
|
In the future, please claim the relevant issue before working on it, so that we can reduce duplicate efforts. |
|
I'll do it. |
bors-servo
added a commit
that referenced
this issue
Oct 6, 2016
Script-generated tests for Servo_* gecko bindings All changes done in #13603, but this time I understand why I should have created a branch instead of doing everything on master. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #13598 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because `they are tests`. <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- 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/13617) <!-- Reviewable:end -->
bors-servo
added a commit
that referenced
this issue
Oct 7, 2016
Script-generated tests for Servo_* gecko bindings All changes done in #13603, but this time I understand why I should have created a branch instead of doing everything on master. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #13598 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because `they are tests`. <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- 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/13617) <!-- Reviewable:end -->
bors-servo
added a commit
that referenced
this issue
Oct 7, 2016
Script-generated tests for Servo_* gecko bindings All changes done in #13603, but this time I understand why I should have created a branch instead of doing everything on master. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #13598 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because `they are tests`. <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- 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/13617) <!-- Reviewable:end -->
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is the first step towards fixing #12992
https://github.com/emilio/servo/blob/c7e1a575a5225ccfb00a38fb50e052d986c0a78d/components/style/gecko_bindings/bindings.rs#L802 contains a bunch of
Servo_*function declarations. These functions are defined inports/geckolib/glue.rs.We need a way of testing that the functions have the same signatures. This can be done by writing code that will not compile if they don't.
The main step here will be to write a python script in
gecko_bindingsthat reads bindings.rs (assume it is in the same directory), and writes atype_assertions.rsfile in the same directory. This file just contains code like the following:for each function in bindings.rs with a
Servo_*signature. Be sure to include the generated file in your pull request.This file can be
include!()ed into a test intests/unit/stylo, where all of the imports have been set up correctly. (This part isn't part of this bug, but feel free to work on it and ask me questions if you have any).I'll hook it up to the main bindgen script later.