Skip to content

The #[start] attribute overrides the test runner implementation #8464

Closed
@mstewartgallus

Description

@mstewartgallus

Consider the code below. When compiled with rustc --test thetest.rs the test suite's code is not run, and the start function is run instead.

use std::rt;

// Compiled with --test it prints Oops!
#[start]
fn start(argc: int, argv: **u8, crate_map: *u8) -> int {
    do rt::start_on_main_thread(argc, argv, crate_map) {
        println("Oops!")
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-frontendArea: Compiler frontend (errors, parsing and HIR)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions