[rust-dev] crate_type = "lib" and testing

Brian Anderson banderson at mozilla.com
Wed Apr 11 13:50:59 PDT 2012


On 04/10/2012 08:07 PM, Alexander Stavonin wrote:
> Hi all,
>
> Question: Why 2 tests was created from just 1 foo_test() test function?
> Also, it's looks like both tests are running parallel and sometimes it
> provoke segmentation faults in case of more complex tests.
>

Yes, tests are run in parallel. I would be interested to see what tests 
this causes issues for. From personal experience I've encountered 
difficulties when tests modify global state, like getenv/setenv. I also 
ran into a major problem with bindings to a library that wasn't threadsafe.

As a hack, if you run with RUST_THREADS=1, the tests will not run in 
parallel.


More information about the Rust-dev mailing list