-
Notifications
You must be signed in to change notification settings - Fork 69
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
can mock c function? error: multiple definition of `get_num' #612
Comments
This is really a duplicate of #602 . I can easily fix it; however that will break one other user's use case. Sadly, I think I'll have to do that. |
If you don't link C libraries, you can, but this is to design the test framework for c, and I want to use cargo test to test rust and c together. So I'd like to be able to mock C, like do_something() in the example, which he didn't import into Rust. |
In your test program, do you expect that |
'get_num' will called by rust function, 'get_num' call another C function -- 'do something', i want mock 'do something' |
But in the example, you showed mocking |
my project with rust and c. i want use rust to rest c function.
when i to make mock c function in rust, get multiple definition error!
use build.rs to build c file.
when i run 'cargo test' error:
multiple definition of `get_num'
Another problem is that: how to mock 'do_someting()'
I hope you can give me some suggestions. thank you very mach!
The text was updated successfully, but these errors were encountered: