commit:     ddb45b4bb42a99dcf16bcfbbd59a8028fd14187e
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 28 12:14:20 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jan 28 12:14:20 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ddb45b4b

cargo.eclass: respect MAKEOPTS for `cargo test`

Without this, while (test) compile jobs respect MAKEOPTS via our config settings
already deployed via the eclass, *test* jobs do not.

We may want to consider setting NEXTEST_TEST_THREADS and/or having
a cargo_enable_tests helper in the eclass at some point too.

Bug: https://github.com/rust-lang/cargo/issues/8430
Signed-off-by: Sam James <sam <AT> gentoo.org>

 eclass/cargo.eclass | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
index 0bc24feea222..25a2127f6391 100644
--- a/eclass/cargo.eclass
+++ b/eclass/cargo.eclass
@@ -396,6 +396,9 @@ cargo_gen_config() {
        jobs = $(makeopts_jobs)
        incremental = false
 
+       [env]
+       RUST_TEST_THREADS = "$(makeopts_jobs)"
+
        [term]
        verbose = true
        $([[ "${NOCOLOR}" = true || "${NOCOLOR}" = yes ]] && echo "color = 
'never'")

Reply via email to