test bindings in an integration-tests crate

This commit is contained in:
Dustin J. Mitchell
2022-01-25 01:27:24 +00:00
parent 56a805151d
commit c006cbe8e5
29 changed files with 4389 additions and 7123 deletions

View File

@@ -0,0 +1,20 @@
// Each suite is represented by a <name>_tests C function in <name>.c.
// All of these C files are built into a library that is linked to the crate -- but not to test
// crates. So, this macro produces a "glue function" that calls the C function, and that can be
// called from test crates.
macro_rules! suite(
{ $s:ident } => {
pub fn $s() -> i32 {
extern "C" {
fn $s() -> i32;
}
unsafe { $s() }
}
};
);
// keep this list in sync with integration-tests/build.rs and integration-tests/tests/bindings.rs.
suite!(uuid_tests);
suite!(string_tests);
suite!(task_tests);
suite!(replica_tests);