From 18d5e9a3bb287ded426b28e4597e499693540906 Mon Sep 17 00:00:00 2001 From: Joining7943 <111500881+Joining7943@users.noreply.github.com> Date: Sat, 15 Apr 2023 10:30:43 +0200 Subject: [PATCH] Update CONTRIBUTING.md: Add nextest usage examples --- CONTRIBUTING.md | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8199b6d87..8f66b2bba 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,4 @@ - + # Contributing to coreutils @@ -137,6 +137,14 @@ If you also want to test the core utilities: cargo test -p uucore -p coreutils ``` +Running the complete test suite might take a while. We use [nextest](https://nexte.st/index.html) in +the CI and you might want to try it out locally. It can speed up the execution time of the whole +test run significantly if the cpu has multiple cores. + +```shell +cargo nextest run --features unix --no-fail-fast +``` + To debug: ```shell @@ -171,6 +179,15 @@ To include tests for unimplemented behavior: make UTILS='UTILITY_1 UTILITY_2' SPEC=y test ``` +To run tests with `nextest` just use the nextest target. Note you'll need to +[install](https://nexte.st/book/installation.html) `nextest` first. The `nextest` target accepts the +same arguments like the default `test` target, so it's possible to pass arguments to `nextest run` +via `CARGOFLAGS`: + +```shell +make CARGOFLAGS='--no-fail-fast' UTILS='UTILITY_1 UTILITY_2' nextest +``` + ### Run Busybox Tests This testing functionality is only available on *nix operating systems and @@ -326,7 +343,6 @@ if changes are not reflected in the report then run `cargo clean` and run the ab If you are using stable version of Rust that doesn't enable code coverage instrumentation by default then add `-Z-Zinstrument-coverage` flag to `RUSTFLAGS` env variable specified above. - ## Other implementations The Coreutils have different implementations, with different levels of completions: @@ -339,10 +355,9 @@ The Coreutils have different implementations, with different levels of completio * [SerenityOS](https://github.com/SerenityOS/serenity/tree/master/Userland/Utilities) * [Initial Unix](https://github.com/dspinellis/unix-history-repo) -However, when reimplementing the tools/options in Rust, don't read their source codes +However, when reimplementing the tools/options in Rust, don't read their source codes when they are using reciprocal licenses (ex: GNU GPL, GNU LGPL, etc). - ## Licensing uutils is distributed under the terms of the MIT License; see the `LICENSE` file