#[cfg(test)]
mod test {
- extern crate rustrt;
-
use std::prelude::*;
- use rustrt::thread::Thread;
+ use thread::Thread;
use super::*;
use task::Task;
#[test]
fn thread_local_task_smoke_test() {
Thread::start(proc() {
- let task = box Task::new();
+ let task = box Task::new(None, None);
Local::put(task);
let task: Box<Task> = Local::take();
cleanup_task(task);
#[test]
fn thread_local_task_two_instances() {
Thread::start(proc() {
- let task = box Task::new();
+ let task = box Task::new(None, None);
Local::put(task);
let task: Box<Task> = Local::take();
cleanup_task(task);
- let task = box Task::new();
+ let task = box Task::new(None, None);
Local::put(task);
let task: Box<Task> = Local::take();
cleanup_task(task);
#[test]
fn borrow_smoke_test() {
Thread::start(proc() {
- let task = box Task::new();
+ let task = box Task::new(None, None);
Local::put(task);
unsafe {
#[test]
fn borrow_with_return() {
Thread::start(proc() {
- let task = box Task::new();
+ let task = box Task::new(None, None);
Local::put(task);
{
#[test]
fn try_take() {
Thread::start(proc() {
- let task = box Task::new();
+ let task = box Task::new(None, None);
Local::put(task);
let t: Box<Task> = Local::try_take().unwrap();
#[cfg(test)]
mod test {
- extern crate rustrt;
-
use super::*;
use std::prelude::*;
use std::task;
+ use unwind;
#[test]
fn tls() {
#[test]
#[should_fail]
fn test_begin_unwind() {
- use rustrt::unwind::begin_unwind;
+ use unwind::begin_unwind;
begin_unwind("cause", &(file!(), line!()))
}
#[test]
fn drop_new_task_ok() {
- drop(Task::new());
+ drop(Task::new(None, None));
}
// Task blocking tests
#[test]
fn block_and_wake() {
- let task = box Task::new();
+ let task = box Task::new(None, None);
let task = BlockedTask::block(task).wake().unwrap();
task.drop();
}
let args = os::args();
let args = args.as_slice();
if args.len() > 1 && args[1].as_slice() == "recurse" {
+ let (tx, rx) = channel();
spawn(proc() {
recurse();
+ tx.send(());
});
+ rx.recv();
} else {
let recurse = Command::new(args[0].as_slice()).arg("recurse").output().unwrap();
assert!(!recurse.status.success());