// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#[crate_type = "bin"];
-#[feature(phase)];
+#![crate_type = "bin"]
+#![feature(phase)]
-#[allow(non_camel_case_types)];
-#[deny(warnings)];
+// we use our own (green) start below; do not link in libnative; issue #13247.
+#![no_start]
+
+#![allow(non_camel_case_types)]
+#![deny(warnings)]
extern crate test;
extern crate getopts;
pub mod errors;
#[start]
-fn start(argc: int, argv: **u8) -> int { green::start(argc, argv, main) }
+fn start(argc: int, argv: **u8) -> int {
+ green::start(argc, argv, rustuv::event_loop, main)
+}
pub fn main() {
let args = os::args();
assert!(!args.is_empty());
let argv0 = (*args.get(0)).clone();
let args_ = args.tail();
- if *args.get(1) == ~"-h" || *args.get(1) == ~"--help" {
+ if *args.get(1) == "-h".to_owned() || *args.get(1) == "--help".to_owned() {
let message = format!("Usage: {} [OPTIONS] [TESTNAME...]", argv0);
println!("{}", getopts::usage(message, groups.as_slice()));
println!("");
logv(c, format!("adb_test_dir: {}", config.adb_test_dir));
logv(c, format!("adb_device_status: {}", config.adb_device_status));
match config.test_shard {
- None => logv(c, ~"test_shard: (all)"),
+ None => logv(c, "test_shard: (all)".to_owned()),
Some((a,b)) => logv(c, format!("test_shard: {}.{}", a, b))
}
logv(c, format!("verbose: {}", config.verbose));
}
pub fn opt_str2(maybestr: Option<~str>) -> ~str {
- match maybestr { None => ~"(none)", Some(s) => { s } }
+ match maybestr { None => "(none)".to_owned(), Some(s) => { s } }
}
pub fn str_mode(s: ~str) -> mode {
pub fn mode_str(mode: mode) -> ~str {
match mode {
- mode_compile_fail => ~"compile-fail",
- mode_run_fail => ~"run-fail",
- mode_run_pass => ~"run-pass",
- mode_pretty => ~"pretty",
- mode_debug_info => ~"debug-info",
- mode_codegen => ~"codegen",
+ mode_compile_fail => "compile-fail".to_owned(),
+ mode_run_fail => "run-fail".to_owned(),
+ mode_run_pass => "run-pass".to_owned(),
+ mode_pretty => "pretty".to_owned(),
+ mode_debug_info => "debug-info".to_owned(),
+ mode_codegen => "codegen".to_owned(),
}
}
pub fn run_tests(config: &config) {
- if config.target == ~"arm-linux-androideabi" {
+ if config.target == "arm-linux-androideabi".to_owned() {
match config.mode{
mode_debug_info => {
println!("arm-linux-androideabi debug-info \
// Pretty-printer does not work with .rc files yet
let valid_extensions =
match config.mode {
- mode_pretty => vec!(~".rs"),
- _ => vec!(~".rc", ~".rs")
+ mode_pretty => vec!(".rs".to_owned()),
+ _ => vec!(".rc".to_owned(), ".rs".to_owned())
};
- let invalid_prefixes = vec!(~".", ~"#", ~"~");
+ let invalid_prefixes = vec!(".".to_owned(), "#".to_owned(), "~".to_owned());
let name = testfile.filename_str().unwrap();
let mut valid = false;