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

Add compile-fail tests #2385

Closed
kmcallister opened this issue May 9, 2014 · 5 comments
Closed

Add compile-fail tests #2385

kmcallister opened this issue May 9, 2014 · 5 comments
Labels
A-testing I-safety Some piece of code violates memory safety guarantees.

Comments

@kmcallister
Copy link
Contributor

As an example, js.rs provides a guarantee that JS-managed objects are rooted when we use them from Rust. The test suite should try to compile some invalid uses of this code and make sure they're rejected. This guards against language changes, compiler bugs, etc.

The same goes for anywhere else in Servo that we attempt to provide static safety guarantees.

@kmcallister
Copy link
Contributor Author

@nikomatsakis and @alexcrichton were talking about Cargo support for compile-fail tests, and many others expressed support for that approach.

@alexcrichton
Copy link
Contributor

cc rust-lang/rust#12335 and rust-lang/cargo#521

The rust issue is likely what's necessary to make progress on the cargo issue, which is in turn needed to make progress on this issue!

@kmcallister
Copy link
Contributor Author

@jdm said he had a cfail test branch for Servo; does it still work?

I'm getting nervous about the lack of testing for our increasingly sophisticated custom static checking.

@jdm
Copy link
Member

jdm commented Oct 13, 2014

I just copied and pasted the Rust compile-fail harness.

@kmcallister kmcallister added this to the Dogfooding milestone May 17, 2015
@jdm jdm removed this from the Dogfooding milestone Jul 19, 2016
@nox
Copy link
Contributor

nox commented Sep 30, 2017

This was done.

@nox nox closed this as completed Sep 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testing I-safety Some piece of code violates memory safety guarantees.
Projects
None yet
Development

No branches or pull requests

4 participants