mozilla/rust — pull request #3939 by brson (2012-11-08 02:21:33+00:00)
Title: Change the way unit tests are built and run

r? @graydon

This series changes the build to stop rebuilding entire crates in order to test them. Instead, the libraries build with the tests, and driver.rs is modified to run the tests directly out of them. It should make cycle times faster.

This will add some binary size to the libraries, but I figure we can have a 'release mode' some day that doesn't build them. It will also slightly increase the normal, non-testing, build times.

To make this work I modified rustc::front::test to fold in the test modifications any time the 'test' cfg is active, allowing the test modifications to be performed on libraries in addition to executables (previously this was only done with the `--test` flag, which both turns on `--cfg test` and `--bin`).

Measurements forthcoming.