Skip to content

Can we centralize all test running to cargo test? #43

@epage

Description

@epage

@_Charles Lew|116458 said:

The features laid out are great, however i'd want to point out the current top-level approach might not be the best in the long run:
Currently unit testing is implemented with a compiler test harness + libtest approach. This works but only under the assumption that the host can run the target executable, which is not the case, especially considering cross-platform scenerio, and the wasm target (see wasm-bindgen-test).

The better approach would be compile to generate a dylib equivalent and always using a test runner to execute that, which can use any capability to run it, including, wine to run windows tests from unix, wasm-bindgen-test-runner to run wasm tests from any platform, qemu to simulate embedded and niche platforms, etc. cargo test can just invoke the proper test runner to execute the tests.

Under this vision, #[test], #[bench]` etc would just be minimal protocols that the test runners can understand(maybe with a shared crate to allow reuse between test runners).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-libtest2Area: libtest implemented on top of the new harnessC-questionUncertainty is involved

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions