diff options
| author | Eric Holk <eholk@mozilla.com> | 2011-06-24 15:37:10 -0700 |
|---|---|---|
| committer | Graydon Hoare <graydon@mozilla.com> | 2011-06-28 16:12:33 -0700 |
| commit | 1c852ac9c0d14b38bc956e3938256273980577b7 (patch) | |
| tree | 5408bedddd156fa9d4c4a49deb2217a899ad43a6 /src/rt/test/rust_test_runtime.cpp | |
| parent | 64596e6583068bd2ee7ac5bad13dbf0668eb345f (diff) | |
| download | rust-1c852ac9c0d14b38bc956e3938256273980577b7.tar.gz rust-1c852ac9c0d14b38bc956e3938256273980577b7.zip | |
Removing runtime tests. The runtime is tested well enough by the standard library tests, so we might as well have less code to fix during refactoring.
Diffstat (limited to 'src/rt/test/rust_test_runtime.cpp')
| -rw-r--r-- | src/rt/test/rust_test_runtime.cpp | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/src/rt/test/rust_test_runtime.cpp b/src/rt/test/rust_test_runtime.cpp deleted file mode 100644 index cf82818c4ff..00000000000 --- a/src/rt/test/rust_test_runtime.cpp +++ /dev/null @@ -1,73 +0,0 @@ -#include "rust_test_runtime.h" - -rust_test_runtime::rust_test_runtime() { -} - -rust_test_runtime::~rust_test_runtime() { -} - -#define DOMAINS 32 -#define TASKS 32 - -void -rust_domain_test::worker::run() { - rust_handle<rust_dom> *handle = kernel->create_domain("test"); - for (int i = 0; i < TASKS; i++) { - handle->referent()->create_task(NULL, "child"); - } - sync::random_sleep(1000); - kernel->destroy_domain(handle->_referent); -} - -bool -rust_domain_test::run() { - rust_srv srv; - rust_kernel kernel(&srv); - - array_list<worker *> workers; - for (int i = 0; i < DOMAINS; i++) { - worker *worker = new rust_domain_test::worker (&kernel); - workers.append(worker); - worker->start(); - } - - // We don't join the worker threads here in order to simulate ad-hoc - // termination of domains. If we join_all_domains before all domains - // are actually spawned, this could crash, thus the reason for the - // sleep below. - - sync::sleep(100); - kernel.join_all_domains(); - return true; -} - -void task_entry() { - printf("task entry\n"); -} - -void -rust_task_test::worker::run() { - rust_handle<rust_dom> *handle = - kernel->create_domain("test"); - rust_dom *domain = handle->referent(); - domain->root_task->start((uintptr_t)&task_entry, (uintptr_t)NULL); - domain->start_main_loop(0); - kernel->destroy_domain(domain); -} - -bool -rust_task_test::run() { - rust_srv srv; - rust_kernel kernel(&srv); - - array_list<worker *> workers; - for (int i = 0; i < DOMAINS; i++) { - worker *worker = new rust_task_test::worker (&kernel, this); - workers.append(worker); - worker->start(); - } - - sync::random_sleep(1000); - kernel.join_all_domains(); - return true; -} |
