diff options
Diffstat (limited to '')
-rw-r--r-- | test cases/rust/4 polyglot/meson.build | 9 | ||||
-rw-r--r-- | test cases/rust/4 polyglot/prog.c | 8 | ||||
-rw-r--r-- | test cases/rust/4 polyglot/stuff.rs | 6 | ||||
-rw-r--r-- | test cases/rust/4 polyglot/test.json | 10 |
4 files changed, 33 insertions, 0 deletions
diff --git a/test cases/rust/4 polyglot/meson.build b/test cases/rust/4 polyglot/meson.build new file mode 100644 index 0000000..3601d5e --- /dev/null +++ b/test cases/rust/4 polyglot/meson.build @@ -0,0 +1,9 @@ +project('rust and c polyglot executable', 'c', 'rust') + +if host_machine.system() == 'darwin' + error('MESON_SKIP_TEST: does not work right on macos, please fix!') +endif + +l = shared_library('stuff', 'stuff.rs', rust_crate_type: 'cdylib', install : true) +e = executable('prog', 'prog.c', link_with : l, install : true) +test('polyglottest', e) diff --git a/test cases/rust/4 polyglot/prog.c b/test cases/rust/4 polyglot/prog.c new file mode 100644 index 0000000..dbbd880 --- /dev/null +++ b/test cases/rust/4 polyglot/prog.c @@ -0,0 +1,8 @@ +#include <stdio.h> + +void f(); + +int main(void) { + printf("Hello from C!\n"); + f(); +} diff --git a/test cases/rust/4 polyglot/stuff.rs b/test cases/rust/4 polyglot/stuff.rs new file mode 100644 index 0000000..ecf623c --- /dev/null +++ b/test cases/rust/4 polyglot/stuff.rs @@ -0,0 +1,6 @@ +#![crate_name = "stuff"] + +#[no_mangle] +pub extern fn f() { + println!("Hello from Rust!"); +} diff --git a/test cases/rust/4 polyglot/test.json b/test cases/rust/4 polyglot/test.json new file mode 100644 index 0000000..a8837a1 --- /dev/null +++ b/test cases/rust/4 polyglot/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": "file", "platform": "msvc", "file": "usr/lib/stuff.dll.lib"}, + {"type": "pdb", "file": "usr/bin/stuff"} + ] +} |