Skip to content

Run bindings tests with whole crate - #13700

Merged
bors-servo merged 1 commit into
servo:masterfrom
Manishearth:bindgen-testing
Oct 12, 2016
Merged

bors-servo merged 1 commit into
servo:masterfrom
Manishearth:bindgen-testing

Conversation

@Manishearth

@Manishearth Manishearth commented Oct 11, 2016 •

Copy link
Copy Markdown
Member

We currently run bindgen's autogenerated #[test] blocks directly on the structs files.

That is, after generating them, we run rustc --test on them. This works fine for now, but
if you want to refer to types defined outside of these files (e.g. in https://bugzilla.mozilla.org/show_bug.cgi?id=1309165),
the tests are broken.

This puts a cargo test -p style in ./mach test-stylo. I disabled doctests because they were failing (unable to find the ns!() and atom!() macros), and I couldn't figure out why -- will investigate in a later bug.

r? @emilio


This change is Reviewable

@highfive

Copy link
Copy Markdown

Heads up! This PR modifies the following files:

  • @bholley: components/style/Cargo.toml, components/style/binding_tools/regen.py
  • @wafflespeanut: python/servo/testing_commands.py

@highfive

Copy link
Copy Markdown

warning Warning warning

  • These commits modify style code, but no tests are modified. Please consider adding a test!

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Oct 11, 2016
return 1

print("OK")
print("(please test with ./mach test-stylo)")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we run this inline? It seems to me it's pretty convenient to have the results of struct layout tests right after generating the bindings.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're running it inline you need the rest of style to compile, which might not be the case in the middle of development.

We could put these tests at the end of everything I guess (so that if it fails it doesn't cancel the next regen).

@emilio

emilio commented Oct 11, 2016

Copy link
Copy Markdown
Member

Do we run both debug and release layout tests on CI?

On Tue, Oct 11, 2016 at 09:36:01AM -0700, Manish Goregaokar wrote:

Manishearth commented on this pull request.

@@ -542,49 +541,11 @@ def zero_size_type(ty, flags):
return 1

 print("OK")
  • print("(please test with ./mach test-stylo)")

If you're running it inline you need the rest of style to compile, which might not be the case in the middle of development.

We could put these tests at the end of everything I guess (so that if it fails it doesn't cancel the next regen).

You are receiving this because you were assigned.
Reply to this email directly or view it on GitHub:
#13700

@Manishearth

Copy link
Copy Markdown
Member Author

No, but I can make that happen for test-stylo.

@Manishearth

Copy link
Copy Markdown
Member Author

blocks #13701

@emilio

emilio commented Oct 11, 2016

Copy link
Copy Markdown
Member

Please do test un both variants. r=me with that

@Manishearth

Copy link
Copy Markdown
Member Author

@bors-servo r=emilio

That can't be done here, it needs to be done on the saltfs side. But added a --release option to make it possible

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit d7f819b has been approved by emilio

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Oct 12, 2016
@Manishearth

Copy link
Copy Markdown
Member Author

@bors-servo p=1

blocks other pr

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit d7f819b with merge fb89d12...

bors-servo pushed a commit that referenced this pull request Oct 12, 2016
Run bindings tests with whole crate

We currently run bindgen's autogenerated `#[test]` blocks directly on the structs files.

That is, after generating them, we run `rustc --test` on them. This works fine for now, but
if you want to refer to types defined outside of these files (e.g. in https://bugzilla.mozilla.org/show_bug.cgi?id=1309165),
the tests are broken.

This puts a `cargo test -p style` in `./mach test-stylo`. I disabled doctests because they were failing (unable to find the `ns!()` and `atom!()` macros), and I couldn't figure out why -- will investigate in a later bug.

r? @emilio

<!-- 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/13700)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - linux-dev

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Oct 12, 2016
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-tests-failed The changes caused existing tests to fail. labels Oct 12, 2016
@Manishearth

Copy link
Copy Markdown
Member Author

@bors-servo r=emilio

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 3d7c997 has been approved by emilio

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Oct 12, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 3d7c997 with merge 7e192ce...

bors-servo pushed a commit that referenced this pull request Oct 12, 2016
Run bindings tests with whole crate

We currently run bindgen's autogenerated `#[test]` blocks directly on the structs files.

That is, after generating them, we run `rustc --test` on them. This works fine for now, but
if you want to refer to types defined outside of these files (e.g. in https://bugzilla.mozilla.org/show_bug.cgi?id=1309165),
the tests are broken.

This puts a `cargo test -p style` in `./mach test-stylo`. I disabled doctests because they were failing (unable to find the `ns!()` and `atom!()` macros), and I couldn't figure out why -- will investigate in a later bug.

r? @emilio

<!-- 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/13700)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

@bors-servo
bors-servo merged commit 3d7c997 into servo:master Oct 12, 2016
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Oct 12, 2016
@Manishearth
Manishearth deleted the bindgen-testing branch October 12, 2016 07:10
bors-servo pushed a commit to servo/saltfs that referenced this pull request Oct 12, 2016
Add release stylo unit tests

servo/servo#13700 moved some important binding layout tests to test-stylo (they used to be run by the regen script).

Currently test-stylo is only run in debug mode. This runs it in release mode as well.

Since linux-rel-css already contains a `./mach build-geckolib --release`, and `test-stylo` just needs a rebuild of style and geckolib (which takes half a minute), this shouldn't cause much of an issue.

However, linux-rel-css is one of our slowest builders. Perhaps both `build-geckolib --release` and `test-stylo --release` should be put in linux-dev instead?

r? @larsbergstrom

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/saltfs/508)
<!-- Reviewable:end -->
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.

4 participants