-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 support for test build scripts #1581
Comments
Indeed, I was expecting to be able to put a demonstration of code-generation tool by putting a cargo project into the |
I think that using build scripts for code generation is relatively common, and this seems like a pretty clear-cut thing that can be added! From a high-level design perspective, there's two possible routes I think we could take:
I think (1) should be avoided because it'd probably break many existing build scripts (which aren't expected to run twice) and it also doesn't allow for dev-build-specific dependencies. Using (2) allows existing build scripts to be backwards compatible as well as adding a new This is a pretty meaty project, however, and it skirts the line of "this requires an RFC", but I'd be willing to help anyone who wishes to implement! |
I'd be interested in taking a look at this, but don't have any idea where to start. |
Closing since this needs an RFC. |
My project has the following constraints:
I was able to workaround this issue using the
That's it! No more separate test crate needed. |
Testing code generation projects like quasi is a little difficult because I would like to use quasi to generate some test files, but I can't since the build scripts are compiled before the main project. As a work around I can add a test crate that depends on quasi, but it would be more convenient if the quasi
Cargo.toml
file had atest-build
script that can depend on the current project and gets run before the tests.The text was updated successfully, but these errors were encountered: