- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 73
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
Provide mechanism to disable test execution #19
Comments
Could you move the main function out of the root module and provide an empty main instead? If not, I think you may be able to bypass main as the entry point by adding: #![feature(start)]
#[start]
fn start(_argc: isize, _argv: *const *const u8) -> isize {
0
} |
Not really; the procedural macro I'm testing ( #![feature(async_await)]
use lambda::{lambda, Error};
#[lambda]
#[runtime::main]
async fn main(s: String) -> Result<String, Error> {
Ok(s)
}
Thanks! That did the trick with: #![feature(async_await, start)]
use lambda::{lambda, Error};
#[lambda]
#[runtime::main]
async fn main(s: String) -> Result<String, Error> {
Ok(s)
}
#[start]
fn start(_argc: isize, _argv: *const *const u8) -> isize {
0
} Bit curious—why does Trybuild execute the procedural macro instead of only building? |
I had the same problem (i was generating the main method too), fixed adding start method. |
Hi! I'm using Trybuild to test some procedural macros in the AWS Lambda Runtime for Rust, and I'm really liking it!
I do have a question, though: there any way to disable TestCases::pass from running the code under test/providing a mechanism to only check for compiler errors?
At runtime, the macro I'm testing with Trybuild makes several assumptions about its environment that include a running server + several environment variables. This results in tests failing with a server connection error, rather than passing due to correct usage of the macro. More concretely, it'd be really handy for my use case if
run_test
would passcheck
rather thanrun
to Cargo.Thanks again for this crate! It's really nice to use, and the test reports are beautifully rendered.
The text was updated successfully, but these errors were encountered: