-
Notifications
You must be signed in to change notification settings - Fork 6
Description
@_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 (seewasm-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).