about summary refs log tree commit diff
path: root/tests/run-make/c-dynamic-rlib/rmake.rs
blob: c48b1edee9e698bbecd5f9f91c6929ef6d4ad893 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// This test checks that dynamic Rust linking with C does not encounter any errors in both
// compilation and execution, with static dependencies given preference over dynamic.
// (This is the default behaviour.)
// See https://github.com/rust-lang/rust/issues/10434

//@ ignore-cross-compile
// Reason: the compiled binary is executed

//FIXME(Oneirical): test on apple because older versions of osx are failing apparently

use run_make_support::{
    build_native_dynamic_lib, dynamic_lib_name, fs_wrapper, run, run_fail, rustc,
};

fn main() {
    build_native_dynamic_lib("cfoo");
    rustc().input("foo.rs").run();
    rustc().input("bar.rs").run();
    run("bar");
    fs_wrapper::remove_file(dynamic_lib_name("cfoo"));
    run_fail("bar");
}