Varun
Varun

Reputation: 41

How do I set the RUST_TEST_TASKS environment variable?

I am attempting to write tests for my Rust program. Normally, these tests are run in parallel but I want to run them sequentially. I looked around and I can set this environment variable RUST_TEST_TASKS=1, but I am not sure where to do that.

Upvotes: 4

Views: 597

Answers (2)

brandonchinn178
brandonchinn178

Reputation: 539

The environment variable is actually RUST_TEST_THREADS

Upvotes: 4

Gerard van Helden
Gerard van Helden

Reputation: 1602

I think what they mean is setting the environment variables in the shell the test runner is running in, such as:

RUST_TEST_TASKS=1 ./my-test-runner

or exporting it:

export RUST_TEST_TASKS=1
./my-test-runner

Upvotes: 2

Related Questions