rust: Add unit test for transitive rust dependencies

pull/12460/head
Sebastian Dröge 2 years ago committed by Xavier Claessens
parent 3500349df1
commit 204563751e
  1. 3
      test cases/rust/20 transitive dependencies/liba/lib.rs
  2. 5
      test cases/rust/20 transitive dependencies/liba/meson.build
  3. 3
      test cases/rust/20 transitive dependencies/libb/lib.rs
  4. 6
      test cases/rust/20 transitive dependencies/libb/meson.build
  5. 3
      test cases/rust/20 transitive dependencies/main.rs
  6. 12
      test cases/rust/20 transitive dependencies/meson.build

@ -0,0 +1,5 @@
liba = static_library('liba', 'lib.rs',
rust_crate_type : 'rlib',
)
liba_dep = declare_dependency(link_with : liba)

@ -0,0 +1,3 @@
pub fn bar() -> i32 {
2 * liba::foo()
}

@ -0,0 +1,6 @@
libb = static_library('libb', 'lib.rs',
rust_crate_type : 'rlib',
dependencies : [liba_dep],
)
libb_dep = declare_dependency(link_with : libb)

@ -0,0 +1,3 @@
fn main() {
println!("{}", libb::bar());
}

@ -0,0 +1,12 @@
project('transitive dependencies', 'rust',
version : '1.0.0',
meson_version : '>= 1.0.0',
default_options : ['rust_std=2018'],
)
subdir('liba')
subdir('libb')
main = executable('main', 'main.rs',
dependencies : [libb_dep],
)
Loading…
Cancel
Save