Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run tests on iOS #25

Closed
SSheldon opened this issue Jun 23, 2015 · 2 comments
Closed

Run tests on iOS #25

SSheldon opened this issue Jun 23, 2015 · 2 comments

Comments

@SSheldon
Copy link
Owner

Support for other architectures was added in e1a9133..2e9192f, so these architectures should also be tested.

This is difficult because Rust's test compile down to an executable, and arbitrary executables can't be run on iOS. rust-lang/rfcs#816 will likely be required to run the existing tests on iOS.

@SSheldon
Copy link
Owner Author

Compiling with --test generates code like:

pub mod __test {
    extern crate test;

    #[main]
    pub fn main() -> () {
        test::test_main_static(::std::env::args(), TESTS);
    }

    const TESTS: &'static [test::TestDescAndFn] = &[
        ...
    ];
}

If this was instead compiled to a library and TESTS was public, it'd be trivial to link against that library and write an iOS app test runner.

@SSheldon
Copy link
Owner Author

SSheldon commented Jul 6, 2015

A test app was created in 2e9192f..2f64ab8, and it's already caught bugs! I still have to run the tests on 32-bit ARM but the coding here is complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant