about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-03-21 18:51:51 -0700
committerbors <bors@rust-lang.org>2014-03-21 18:51:51 -0700
commitbbf8cdc43feea08111abc5a59dc49a7f479d3103 (patch)
treed950bd4e8c38fae4bdc1c62e615f187416d6884b /src/libstd
parent3e3a3cf712ec1032420d1d10504b92cea6973da6 (diff)
parente7c4fb692bc0daf519da1d84132cda151d0fb4b1 (diff)
downloadrust-bbf8cdc43feea08111abc5a59dc49a7f479d3103.tar.gz
rust-bbf8cdc43feea08111abc5a59dc49a7f479d3103.zip
auto merge of #12833 : alexcrichton/rust/libnative, r=brson
The compiler will no longer inject libgreen as the default runtime for rust
programs, this commit switches it over to libnative by default. Now that
libnative has baked for some time, it is ready enough to start getting more
serious usage as the default runtime for rustc generated binaries.

We've found that there isn't really a correct decision in choosing a 1:1 or M:N
runtime as a default for all applications, but it seems that a larger number of
programs today would work more reasonably with a native default rather than a
green default.

With this commit come a number of bugfixes:

* The main native task is now named `<main>`
* The main native task has the stack bounds set up properly
* #[no_uv] was renamed to #[no_start]
* The core-run-destroy test was rewritten for both libnative and libgreen and
  one of the tests was modified to be more robust.
* The process-detach test was locked to libgreen because it uses signal handling
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/lib.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs
index 433400cc9f0..7d734469b12 100644
--- a/src/libstd/lib.rs
+++ b/src/libstd/lib.rs
@@ -81,6 +81,16 @@
 #[cfg(stage0)]
 pub use vec_ng = vec;
 
+// Run tests with libgreen instead of libnative.
+//
+// FIXME: This egregiously hacks around starting the test runner in a different
+//        threading mode than the default by reaching into the auto-generated
+//        '__test' module.
+#[cfg(test)] #[start]
+fn start(argc: int, argv: **u8) -> int {
+    green::start(argc, argv, __test::main)
+}
+
 pub mod macros;
 
 mod rtdeps;