Add a test for expanding dependencies with Cargo.lock v2, with both conflicting and non-conflicting deps.

This commit is contained in:
Emilio Cobos Álvarez
2019-12-20 23:27:03 +01:00
parent 6a9066f7cd
commit b912c04a7d
8 changed files with 69 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "dep"
version = "0.1.0"
[[package]]
name = "dep"
version = "0.2.0"
[[package]]
name = "expand-dep"
version = "0.1.0"
dependencies = [
"dep 0.1.0",
]
[[package]]
name = "expand-dep-2"
version = "0.2.0"
dependencies = [
"dep 0.2.0",
"expand-dep",
]
+9
View File
@@ -0,0 +1,9 @@
[package]
name = "expand-dep-2"
version = "0.2.0"
authors = ["cbindgen"]
edition = "2018"
[dependencies]
expand-dep = { path = "../expand_dep" }
dep = { path = "dep_v2" }
+6
View File
@@ -0,0 +1,6 @@
[parse]
parse_deps = true
include = ["dep"]
[parse.expand]
crates = ["expand-dep"]
+7
View File
@@ -0,0 +1,7 @@
[package]
name = "dep"
version = "0.1.0"
authors = ["cbindgen"]
edition = "2018"
[dependencies]
+5
View File
@@ -0,0 +1,5 @@
#[repr(C)]
pub struct dep_struct {
pub x: u32,
pub y: f64,
}
@@ -0,0 +1,7 @@
[package]
name = "dep"
version = "0.2.0"
authors = ["cbindgen"]
edition = "2018"
[dependencies]
@@ -0,0 +1,5 @@
#[repr(C)]
pub struct dep_struct {
pub x: u32,
pub y: f64,
}
+6
View File
@@ -0,0 +1,6 @@
use dep::dep_struct;
#[no_mangle]
pub unsafe extern "C" fn get_x(dep_struct: *const dep_struct) -> u32 {
dep_struct.read().x
}