about summary refs log tree commit diff
path: root/src/libstd/lib.rs
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2014-08-09 00:01:05 +1000
committerHuon Wilson <dbau.pp+github@gmail.com>2014-08-09 13:00:58 +1000
commitedc9191921a9ef8ff8438a10b5f315ae9190e48c (patch)
treeee5731df5eda2b73d0d522c864fe2b6ef604aade /src/libstd/lib.rs
parentc3284733e3effa92cff2f87b7a38c27ac781411e (diff)
downloadrust-edc9191921a9ef8ff8438a10b5f315ae9190e48c.tar.gz
rust-edc9191921a9ef8ff8438a10b5f315ae9190e48c.zip
testsuite: implement #[reexport_test_harness_name] to get access to the
default entrypoint of the --test binary.

This allows one to, e.g., run tests under libgreen by starting it
manually, passing in the test entrypoint.
Diffstat (limited to 'src/libstd/lib.rs')
-rw-r--r--src/libstd/lib.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs
index 125c3fdf5d9..20fc7efeb57 100644
--- a/src/libstd/lib.rs
+++ b/src/libstd/lib.rs
@@ -114,6 +114,8 @@
 #![allow(deprecated)]
 #![deny(missing_doc)]
 
+#![reexport_test_harness_main = "test_main"]
+
 // When testing libstd, bring in libuv as the I/O backend so tests can print
 // things and all of the std::io tests have an I/O interface to run on top
 // of
@@ -186,13 +188,9 @@ pub use unicode::char;
 pub use core_sync::comm;
 
 // 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: *const *const u8) -> int {
-    green::start(argc, argv, rustuv::event_loop, __test::main)
+    green::start(argc, argv, rustuv::event_loop, test_main)
 }
 
 /* Exported macros */