Skip to content

mk: Move rust_test_helpers out of libstd #14677

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mk/crates.mk
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ DEPS_collections := core alloc
DEPS_fourcc := syntax std
DEPS_hexfloat := syntax std
DEPS_num := std
DEPS_test := std getopts serialize term time regex
DEPS_test := std getopts serialize term time regex native:rust_test_helpers
DEPS_time := std serialize sync
DEPS_rand := core
DEPS_url := std
Expand Down
5 changes: 3 additions & 2 deletions mk/rt.mk
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
# that's per-target so you're allowed to conditionally add files based on the
# target.
################################################################################
NATIVE_LIBS := rustrt hoedown uv_support morestack miniz context_switch
NATIVE_LIBS := rustrt hoedown uv_support morestack miniz context_switch \
rust_test_helpers

# $(1) is the target triple
define NATIVE_LIBRARIES
Expand All @@ -53,9 +54,9 @@ NATIVE_DEPS_uv_support_$(1) := rust_uv.c
NATIVE_DEPS_miniz_$(1) = miniz.c
NATIVE_DEPS_rustrt_$(1) := rust_builtin.c \
rust_android_dummy.c \
rust_test_helpers.c \
rust_try.ll \
arch/$$(HOST_$(1))/record_sp.S
NATIVE_DEPS_rust_test_helpers_$(1) := rust_test_helpers.c
NATIVE_DEPS_morestack_$(1) := arch/$$(HOST_$(1))/morestack.S
NATIVE_DEPS_context_switch_$(1) := \
arch/$$(HOST_$(1))/_context.S
Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/anon-extern-mod-cross-crate-1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

extern crate libc;

#[link(name="rustrt")]
#[link(name="rust_test_helpers")]
extern {
pub fn rust_get_test_int() -> libc::intptr_t;
}
2 changes: 1 addition & 1 deletion src/test/auxiliary/extern-crosscrate-source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ extern crate libc;
pub mod rustrt {
extern crate libc;

#[link(name = "rustrt")]
#[link(name = "rust_test_helpers")]
extern {
pub fn rust_dbg_call(cb: extern "C" fn(libc::uintptr_t) -> libc::uintptr_t,
data: libc::uintptr_t)
Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/foreign_lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
pub mod rustrt {
extern crate libc;

#[link(name = "rustrt")]
#[link(name = "rust_test_helpers")]
extern {
fn rust_get_test_int() -> libc::intptr_t;
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/anon-extern-mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

extern crate libc;

#[link(name = "rustrt")]
#[link(name = "rust_test_helpers")]
extern {
fn rust_get_test_int() -> libc::intptr_t;
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/c-stack-as-value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
mod rustrt {
extern crate libc;

#[link(name = "rustrt")]
#[link(name = "rust_test_helpers")]
extern {
pub fn rust_get_test_int() -> libc::intptr_t;
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/extern-call-deep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ extern crate libc;
mod rustrt {
extern crate libc;

#[link(name = "rustrt")]
#[link(name = "rust_test_helpers")]
extern {
pub fn rust_dbg_call(cb: extern "C" fn(libc::uintptr_t) -> libc::uintptr_t,
data: libc::uintptr_t)
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/extern-call-deep2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use std::task;
mod rustrt {
extern crate libc;

#[link(name = "rustrt")]
#[link(name = "rust_test_helpers")]
extern {
pub fn rust_dbg_call(cb: extern "C" fn(libc::uintptr_t) -> libc::uintptr_t,
data: libc::uintptr_t)
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/extern-call-indirect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ extern crate libc;
mod rustrt {
extern crate libc;

#[link(name = "rustrt")]
#[link(name = "rust_test_helpers")]
extern {
pub fn rust_dbg_call(cb: extern "C" fn(libc::uintptr_t) -> libc::uintptr_t,
data: libc::uintptr_t)
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/extern-call-scrub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use std::task;
mod rustrt {
extern crate libc;

#[link(name = "rustrt")]
#[link(name = "rust_test_helpers")]
extern {
pub fn rust_dbg_call(cb: extern "C" fn(libc::uintptr_t) -> libc::uintptr_t,
data: libc::uintptr_t)
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/extern-pass-TwoU16s.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ struct TwoU16s {
one: u16, two: u16
}

#[link(name = "rustrt")]
#[link(name = "rust_test_helpers")]
extern {
pub fn rust_dbg_extern_identity_TwoU16s(v: TwoU16s) -> TwoU16s;
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/extern-pass-TwoU32s.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ struct TwoU32s {
one: u32, two: u32
}

#[link(name = "rustrt")]
#[link(name = "rust_test_helpers")]
extern {
pub fn rust_dbg_extern_identity_TwoU32s(v: TwoU32s) -> TwoU32s;
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/extern-pass-TwoU64s.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ struct TwoU64s {
one: u64, two: u64
}

#[link(name = "rustrt")]
#[link(name = "rust_test_helpers")]
extern {
pub fn rust_dbg_extern_identity_TwoU64s(v: TwoU64s) -> TwoU64s;
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/extern-pass-TwoU8s.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ struct TwoU8s {
one: u8, two: u8
}

#[link(name = "rustrt")]
#[link(name = "rust_test_helpers")]
extern {
pub fn rust_dbg_extern_identity_TwoU8s(v: TwoU8s) -> TwoU8s;
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/extern-pass-char.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

// Test a function that takes/returns a u8.

#[link(name = "rustrt")]
#[link(name = "rust_test_helpers")]
extern {
pub fn rust_dbg_extern_identity_u8(v: u8) -> u8;
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/extern-pass-double.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[link(name = "rustrt")]
#[link(name = "rust_test_helpers")]
extern {
pub fn rust_dbg_extern_identity_double(v: f64) -> f64;
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/extern-pass-empty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ struct ManyInts {

struct Empty;

#[link(name = "rustrt")]
#[link(name = "rust_test_helpers")]
extern {
fn rust_dbg_extern_empty_struct(v1: ManyInts, e: Empty, v2: ManyInts);
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/extern-pass-u32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

// Test a function that takes/returns a u32.

#[link(name = "rustrt")]
#[link(name = "rust_test_helpers")]
extern {
pub fn rust_dbg_extern_identity_u32(v: u32) -> u32;
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/extern-pass-u64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

// Test a call to a function that takes/returns a u64.

#[link(name = "rustrt")]
#[link(name = "rust_test_helpers")]
extern {
pub fn rust_dbg_extern_identity_u64(v: u64) -> u64;
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/extern-return-TwoU16s.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ struct TwoU16s {
one: u16, two: u16
}

#[link(name = "rustrt")]
#[link(name = "rust_test_helpers")]
extern {
pub fn rust_dbg_extern_return_TwoU16s() -> TwoU16s;
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/extern-return-TwoU32s.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ struct TwoU32s {
one: u32, two: u32
}

#[link(name = "rustrt")]
#[link(name = "rust_test_helpers")]
extern {
pub fn rust_dbg_extern_return_TwoU32s() -> TwoU32s;
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/extern-return-TwoU64s.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ struct TwoU64s {
one: u64, two: u64
}

#[link(name = "rustrt")]
#[link(name = "rust_test_helpers")]
extern {
pub fn rust_dbg_extern_return_TwoU64s() -> TwoU64s;
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/extern-return-TwoU8s.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ struct TwoU8s {
one: u8, two: u8
}

#[link(name = "rustrt")]
#[link(name = "rust_test_helpers")]
extern {
pub fn rust_dbg_extern_return_TwoU8s() -> TwoU8s;
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/extern-stress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use std::task;
mod rustrt {
extern crate libc;

#[link(name = "rustrt")]
#[link(name = "rust_test_helpers")]
extern {
pub fn rust_dbg_call(cb: extern "C" fn(libc::uintptr_t) -> libc::uintptr_t,
data: libc::uintptr_t)
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/extern-yield.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use std::task;
mod rustrt {
extern crate libc;

#[link(name = "rustrt")]
#[link(name = "rust_test_helpers")]
extern {
pub fn rust_dbg_call(cb: extern "C" fn (libc::uintptr_t) -> libc::uintptr_t,
data: libc::uintptr_t)
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/foreign-call-no-runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ extern crate libc;
use std::mem;
use std::rt::thread::Thread;

#[link(name = "rustrt")]
#[link(name = "rust_test_helpers")]
extern {
fn rust_dbg_call(cb: extern "C" fn(libc::uintptr_t),
data: libc::uintptr_t) -> libc::uintptr_t;
Expand Down
4 changes: 2 additions & 2 deletions src/test/run-pass/foreign-dupe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
mod rustrt1 {
extern crate libc;

#[link(name = "rustrt")]
#[link(name = "rust_test_helpers")]
extern {
pub fn rust_get_test_int() -> libc::intptr_t;
}
Expand All @@ -22,7 +22,7 @@ mod rustrt1 {
mod rustrt2 {
extern crate libc;

#[link(name = "rustrt")]
#[link(name = "rust_test_helpers")]
extern {
pub fn rust_get_test_int() -> libc::intptr_t;
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/foreign-no-abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
mod rustrt {
extern crate libc;

#[link(name = "rustrt")]
#[link(name = "rust_test_helpers")]
extern {
pub fn rust_get_test_int() -> libc::intptr_t;
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/static-mut-foreign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

extern crate libc;

#[link(name = "rustrt")]
#[link(name = "rust_test_helpers")]
extern {
static mut rust_dbg_static_mut: libc::c_int;
pub fn rust_dbg_static_mut_check_four();
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/struct-return.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub struct Floats { a: f64, b: u8, c: f64 }
mod rustrt {
use super::{Floats, Quad};

#[link(name = "rustrt")]
#[link(name = "rust_test_helpers")]
extern {
pub fn rust_dbg_abi_1(q: Quad) -> Quad;
pub fn rust_dbg_abi_2(f: Floats) -> Floats;
Expand Down