diff options
Diffstat (limited to 'meson/test cases/rust/2 sharedlib')
-rw-r--r-- | meson/test cases/rust/2 sharedlib/meson.build | 16 | ||||
-rw-r--r-- | meson/test cases/rust/2 sharedlib/prog.rs | 3 | ||||
-rw-r--r-- | meson/test cases/rust/2 sharedlib/stuff.rs | 3 | ||||
-rw-r--r-- | meson/test cases/rust/2 sharedlib/test.json | 10 |
4 files changed, 32 insertions, 0 deletions
diff --git a/meson/test cases/rust/2 sharedlib/meson.build b/meson/test cases/rust/2 sharedlib/meson.build new file mode 100644 index 000000000..aac296810 --- /dev/null +++ b/meson/test cases/rust/2 sharedlib/meson.build @@ -0,0 +1,16 @@ +project('rust shared library', 'rust') + +if host_machine.system() == 'darwin' + error('MESON_SKIP_TEST: doesnt work right on macos, please fix!') +endif + +l = shared_library('stuff', 'stuff.rs', install : true) +e = executable('prog', 'prog.rs', link_with : l, install : true) + +if build_machine.system() == 'windows' + rustup = find_program('rustup') + test('linktest', rustup, + args: ['run', 'stable', e]) +else + test('linktest', e) +endif diff --git a/meson/test cases/rust/2 sharedlib/prog.rs b/meson/test cases/rust/2 sharedlib/prog.rs new file mode 100644 index 000000000..fbf318159 --- /dev/null +++ b/meson/test cases/rust/2 sharedlib/prog.rs @@ -0,0 +1,3 @@ +extern crate stuff; + +fn main() { println!("printing: {}", stuff::explore()); } diff --git a/meson/test cases/rust/2 sharedlib/stuff.rs b/meson/test cases/rust/2 sharedlib/stuff.rs new file mode 100644 index 000000000..8cabc6257 --- /dev/null +++ b/meson/test cases/rust/2 sharedlib/stuff.rs @@ -0,0 +1,3 @@ +#![crate_name = "stuff"] + +pub fn explore() -> &'static str { "librarystring" } diff --git a/meson/test cases/rust/2 sharedlib/test.json b/meson/test cases/rust/2 sharedlib/test.json new file mode 100644 index 000000000..585fdeb69 --- /dev/null +++ b/meson/test cases/rust/2 sharedlib/test.json @@ -0,0 +1,10 @@ +{ + "installed": [ + {"type": "exe", "file": "usr/bin/prog"}, + {"type": "pdb", "file": "usr/bin/prog"}, + {"type": "file", "platform": "gcc", "file": "usr/lib/libstuff.so"}, + {"type": "file", "platform": "msvc", "file": "usr/bin/stuff.dll"}, + {"type": "pdb", "file": "usr/bin/stuff"}, + {"type": "file", "platform": "msvc", "file": "usr/lib/stuff.dll.lib"} + ] +} |