Add integration test for lib injection

This commit is contained in:
Dimitris Zervas
2023-06-03 18:02:46 +03:00
parent 9180d62d67
commit 141bf26048
9 changed files with 109 additions and 21 deletions

12
tests/mybin/src/main.rs Normal file
View File

@ -0,0 +1,12 @@
#[link(name = "mylib", kind = "dylib")]
extern {
fn mylib_foo() -> u8;
fn mylib_bar() -> u8;
}
fn main() {
println!("Hello, world!");
assert_eq!(unsafe { mylib_bar() }, 100);
std::process::exit(unsafe { mylib_foo() } as i32);
}