From a702a1709b4ec2653bc3201a6c61f35f83c7a049 Mon Sep 17 00:00:00 2001 From: Aphek Date: Sat, 2 Oct 2021 20:05:54 -0300 Subject: [PATCH 1/2] Update unit tests instructions, explain how to run them individually --- DEVELOPMENT.md | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 4d65c4318c..3cf83e452b 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -62,7 +62,34 @@ $ pytest -v Rust unit tests can be run with `cargo`: ```shell -$ cargo test --all +$ cargo test --workspace --exclude rustpython_wasm +``` + +Python unit tests can be run by compiling RustPython and running the test module: + +```shell +$ cargo run --release -- -m test +``` + +There are a few test options that are specially useful: + +- `-j ` enables parallel testing (which is a lot faster), where `` is the +number of threads to be used, ideally the same as number of cores on your CPU. +If you don't know, `-j 4` or `-j 8` are good options. +- `-v` enables verbose mode, adding additional information about the tests being +run. +- `` specifies a single test to run instead of running all tests. + +For example, to run all tests in parallel: + +```shell +$ cargo run --release -- -m test -j 4 +``` + +To run only `test_cmath` (located at `Lib/test/test_cmath`) verbosely: + +```shell +$ cargo run --release -- -m test test_cmath -v ``` ## Profiling From 66c00272a09ed0cdbf872836c2d978d5a14ab75c Mon Sep 17 00:00:00 2001 From: Aphek Date: Sat, 2 Oct 2021 23:09:42 -0300 Subject: [PATCH 2/2] Fix grammar in DEVELOPMENT.md Co-authored-by: fanninpm --- DEVELOPMENT.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 3cf83e452b..6048a896fb 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -71,7 +71,7 @@ Python unit tests can be run by compiling RustPython and running the test module $ cargo run --release -- -m test ``` -There are a few test options that are specially useful: +There are a few test options that are especially useful: - `-j ` enables parallel testing (which is a lot faster), where `` is the number of threads to be used, ideally the same as number of cores on your CPU.