>From 6c2a02b00dfa943a799b18c7333ca24cf4da7b04 Mon Sep 17 00:00:00 2001 From: idealseal <[email protected]> Date: Mon, 9 Mar 2026 13:13:38 +0000 Subject: [PATCH 0/2] cargo.eclass: add array for skipping tests
Add a simple array that can be used in cargo_src_test to list test names that should be skipped. idealseal (2): cargo.eclass: add array for skipping tests */*: use skip_tests variable from cargo.eclass app-editors/zed/zed-0.226.4.ebuild | 5 ++- app-misc/skim/skim-1.5.1.ebuild | 12 +++--- app-misc/skim/skim-1.9.1.ebuild | 12 +++--- app-misc/skim/skim-2.0.2.ebuild | 12 +++--- app-text/mdbook/mdbook-0.4.52.ebuild | 8 ++-- dev-util/bear/bear-4.0.4.ebuild | 16 ++++--- dev-util/maturin/maturin-1.11.5.ebuild | 20 ++++----- dev-util/maturin/maturin-1.12.5.ebuild | 20 ++++----- dev-util/maturin/maturin-1.12.6.ebuild | 20 ++++----- dev-vcs/jj/jj-0.36.0.ebuild | 9 ++-- dev-vcs/jj/jj-0.37.0.ebuild | 7 +--- dev-vcs/jj/jj-0.38.0.ebuild | 7 +--- dev-vcs/jj/jj-0.39.0.ebuild | 7 +--- eclass/cargo.eclass | 46 ++++++++++++++++++++- net-analyzer/rustscan/rustscan-2.4.1.ebuild | 14 +++---- net-misc/hurl/hurl-7.0.0.ebuild | 10 +++-- sys-process/below/below-0.11.0-r1.ebuild | 16 +++---- 17 files changed, 143 insertions(+), 98 deletions(-) -- 2.53.0 >From b4e247cbf44cf426cd48aa7ab3413ceed0963531 Mon Sep 17 00:00:00 2001 From: idealseal <[email protected]> Date: Mon, 9 Mar 2026 11:59:04 +0000 Subject: [PATCH 1/2] cargo.eclass: add array for skipping tests MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------2.53.0" This is a multi-part message in MIME format. --------------2.53.0 Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit Add an array 'skip_tests' that can be declared to skip multiple tests. All test names will be converted to the right command line flag for cargo test. Signed-off-by: idealseal <[email protected]> --- eclass/cargo.eclass | 46 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) --------------2.53.0 Content-Type: text/x-patch; name="0001-cargo.eclass-add-array-for-skipping-tests.patch" Content-Transfer-Encoding: 8bit Content-Disposition: inline; filename="0001-cargo.eclass-add-array-for-skipping-tests.patch" diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass index 76d3b9a61a64..05744a26141f 100644 --- a/eclass/cargo.eclass +++ b/eclass/cargo.eclass @@ -201,6 +201,22 @@ ECARGO_VENDOR="${ECARGO_HOME}/gentoo" # } # @CODE +# @ECLASS_VARIABLE: skip_tests +# @DEFAULT_UNSET +# @DESCRIPTION: +# Optional array of test names to be skipped +# Should be defined before calling cargo_src_test. +# +# @CODE +# src_test() { +# local skip_tests=( +# tests::filesystem +# tests::network +# ) +# cargo_src_test --no-fail-fast +# } +# @CODE + # @ECLASS_VARIABLE: ECARGO_HOME # @OUTPUT_VARIABLE # @DESCRIPTION: @@ -836,7 +852,35 @@ cargo_src_test() { _cargo_check_initialized - set -- "${CARGO}" test $(usex debug "" --release) ${ECARGO_ARGS[@]} "$@" + # This is the same as myfeatures in cargo_src_configure: + # Prefix all test names with '--skip'. + [[ -z ${skip_tests} ]] && declare -a skip_tests=() + local skip_teststype=$(declare -p skip_tests 2>&-) + if [[ "${skip_teststype}" != "declare -a skip_tests="* ]]; then + die "skip_tests must be declared as array" + fi + + skip_tests=( ${skip_tests[@]/#/--skip } ) + + # The skip flags must be passed to the test harness, after a '--' + # on the command line. + # To avoid breakage if the caller of cargo_src_test also passes '--', + # we split the caller args and group the skip args together with the + # caller args. + local args=( $@ ) + + sep="${#args}" + for i in "${!args[@]}"; do + [[ "${args[i]}" == "--" ]] && sep="$i"; + done + + cargo_test_args=( ${args[@]:0:sep} ) + test_harness_args=( -- ${skip_tests[@]} ${args[@]:sep} ) + + set -- "${CARGO}" test $(usex debug "" --release) \ + ${ECARGO_ARGS[@]} \ + ${cargo_test_args[@]} \ + ${test_harness_args[@]} einfo "${@}" cargo_env "${@}" || die "cargo test failed" } --------------2.53.0-- >From 6c2a02b00dfa943a799b18c7333ca24cf4da7b04 Mon Sep 17 00:00:00 2001 From: idealseal <[email protected]> Date: Mon, 9 Mar 2026 13:00:38 +0000 Subject: [PATCH 2/2] */*: use skip_tests variable from cargo.eclass MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------2.53.0" This is a multi-part message in MIME format. --------------2.53.0 Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit Signed-off-by: idealseal <[email protected]> --- app-editors/zed/zed-0.226.4.ebuild | 5 +++-- app-misc/skim/skim-1.5.1.ebuild | 12 +++++++----- app-misc/skim/skim-1.9.1.ebuild | 12 +++++++----- app-misc/skim/skim-2.0.2.ebuild | 12 +++++++----- app-text/mdbook/mdbook-0.4.52.ebuild | 8 ++++---- dev-util/bear/bear-4.0.4.ebuild | 16 ++++++++++------ dev-util/maturin/maturin-1.11.5.ebuild | 20 ++++++++++---------- dev-util/maturin/maturin-1.12.5.ebuild | 20 ++++++++++---------- dev-util/maturin/maturin-1.12.6.ebuild | 20 ++++++++++---------- dev-vcs/jj/jj-0.36.0.ebuild | 9 +++------ dev-vcs/jj/jj-0.37.0.ebuild | 7 ++----- dev-vcs/jj/jj-0.38.0.ebuild | 7 ++----- dev-vcs/jj/jj-0.39.0.ebuild | 7 ++----- net-analyzer/rustscan/rustscan-2.4.1.ebuild | 14 +++++++------- net-misc/hurl/hurl-7.0.0.ebuild | 10 ++++++---- sys-process/below/below-0.11.0-r1.ebuild | 16 ++++++++-------- 16 files changed, 98 insertions(+), 97 deletions(-) --------------2.53.0 Content-Type: text/x-patch; name="0002-use-skip_tests-variable-from-cargo.eclass.patch" Content-Transfer-Encoding: 8bit Content-Disposition: inline; filename="0002-use-skip_tests-variable-from-cargo.eclass.patch" diff --git a/app-editors/zed/zed-0.226.4.ebuild b/app-editors/zed/zed-0.226.4.ebuild index 6154107f72d0..af02eaa92fb2 100644 --- a/app-editors/zed/zed-0.226.4.ebuild +++ b/app-editors/zed/zed-0.226.4.ebuild @@ -240,6 +240,7 @@ src_test () { mkdir -p "${HOME}/.config/zed" || die mkdir -p "${HOME}/.local/share/zed/logs/" || die - SHELL=/usr/bin/sh RUST_BACKTRACE=full cargo_src_test -vv \ - -- --skip zed::tests::test_window_edit_state_restoring_enabled + local skip_tests=( zed::tests::test_window_edit_state_restoring_enabled ) + + SHELL=/usr/bin/sh RUST_BACKTRACE=full cargo_src_test -vv } diff --git a/app-misc/skim/skim-1.5.1.ebuild b/app-misc/skim/skim-1.5.1.ebuild index d699d0cbbb28..b04ab5269345 100644 --- a/app-misc/skim/skim-1.5.1.ebuild +++ b/app-misc/skim/skim-1.5.1.ebuild @@ -335,11 +335,13 @@ src_configure() { } src_test() { - cargo_src_test --bins --lib -- \ - --skip test_ansi_flag_disabled \ - --skip test_ansi_flag_enabled \ - --skip test_ansi_flag_no_strip \ - --skip test_ansi_matching_on_stripped_text + local skip_tests=( + test_ansi_flag_disabled + test_ansi_flag_enabled + test_ansi_flag_no_strip + test_ansi_matching_on_stripped_text + ) + cargo_src_test } src_install() { diff --git a/app-misc/skim/skim-1.9.1.ebuild b/app-misc/skim/skim-1.9.1.ebuild index 7141c39f3e2a..901f80a6f851 100644 --- a/app-misc/skim/skim-1.9.1.ebuild +++ b/app-misc/skim/skim-1.9.1.ebuild @@ -336,11 +336,13 @@ src_configure() { } src_test() { - cargo_src_test --bins --lib -- \ - --skip test_ansi_flag_disabled \ - --skip test_ansi_flag_enabled \ - --skip test_ansi_flag_no_strip \ - --skip test_ansi_matching_on_stripped_text + local skip_tests=( + test_ansi_flag_disabled + test_ansi_flag_enabled + test_ansi_flag_no_strip + test_ansi_matching_on_stripped_text + ) + cargo_src_test } src_install() { diff --git a/app-misc/skim/skim-2.0.2.ebuild b/app-misc/skim/skim-2.0.2.ebuild index ba974ddf70d1..a7ec302c148e 100644 --- a/app-misc/skim/skim-2.0.2.ebuild +++ b/app-misc/skim/skim-2.0.2.ebuild @@ -348,11 +348,13 @@ src_configure() { } src_test() { - cargo_src_test --bins --lib -- \ - --skip test_ansi_flag_disabled \ - --skip test_ansi_flag_enabled \ - --skip test_ansi_flag_no_strip \ - --skip test_ansi_matching_on_stripped_text + local skip_tests=( + test_ansi_flag_disabled + test_ansi_flag_enabled + test_ansi_flag_no_strip + test_ansi_matching_on_stripped_text + ) + cargo_src_test } src_install() { diff --git a/app-text/mdbook/mdbook-0.4.52.ebuild b/app-text/mdbook/mdbook-0.4.52.ebuild index bc0a65085b57..c734191bb81d 100644 --- a/app-text/mdbook/mdbook-0.4.52.ebuild +++ b/app-text/mdbook/mdbook-0.4.52.ebuild @@ -1,4 +1,4 @@ -# Copyright 2021-2025 Gentoo Authors +# Copyright 2021-2026 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -39,12 +39,12 @@ src_compile() { src_test() { local -x COLUMNS=100 #960393 - local skip=( + local skip_tests=( # fails with usersandbox - --skip test_ignore_canonical + test_ignore_canonical ) - cargo_src_test -- "${skip[@]}" + cargo_src_test } src_install() { diff --git a/dev-util/bear/bear-4.0.4.ebuild b/dev-util/bear/bear-4.0.4.ebuild index 105b4686fb69..74b52983ff2a 100644 --- a/dev-util/bear/bear-4.0.4.ebuild +++ b/dev-util/bear/bear-4.0.4.ebuild @@ -166,13 +166,17 @@ src_test() { -F allow-integration-tests ) cargo_src_compile "${args[@]}" + # https://github.com/rizsotto/Bear/issues/675 - cargo_src_test "${args[@]}" -- \ - --skip cases::intercept_posix::execv_interception \ - --skip cases::intercept_posix::execve_interception \ - --skip cases::intercept_posix::execvp_interception \ - --skip cases::intercept_posix::execvpe_interception \ - --skip cases::intercept_posix::execle_interception + local skip_tests=( + cases::intercept_posix::execv_interception + cases::intercept_posix::execve_interception + cases::intercept_posix::execvp_interception + cases::intercept_posix::execvpe_interception + cases::intercept_posix::execle_interception + ) + + cargo_src_test ${args[@]} } src_install() { diff --git a/dev-util/maturin/maturin-1.11.5.ebuild b/dev-util/maturin/maturin-1.11.5.ebuild index 15ac1adad6e1..780679dd6a8b 100644 --- a/dev-util/maturin/maturin-1.11.5.ebuild +++ b/dev-util/maturin/maturin-1.11.5.ebuild @@ -122,25 +122,25 @@ python_test() { # need this for (new) python versions not yet recognized by pyo3 local -x PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 - local skip=( + local skip_tests=( # picky cli output test that easily benignly fail (bug #937992) - --skip cli_tests + cli_tests # avoid need for wasm over a single hello world test - --skip integration_wasm_hello_world + integration_wasm_hello_world # fragile depending on rust version, also wants libpypy*-c.so for pypy - --skip pyo3_no_extension_module + pyo3_no_extension_module # unimportant tests that require uv, and not obvious to get it # to work with network-sandbox (not worth the trouble) - --skip develop_hello_world::case_2 - --skip develop_pyo3_ffi_pure::case_2 + develop_hello_world::case_2 + develop_pyo3_ffi_pure::case_2 # compliance test using zig requires an old libc to pass (bug #946967) - --skip integration_pyo3_mixed_py_subdir + integration_pyo3_mixed_py_subdir # these currently attempt to install tomli regardless of python version - --skip pep517_default_profile - --skip pep517_editable_profile + pep517_default_profile + pep517_editable_profile ) - cargo_src_test -- "${skip[@]}" + cargo_src_test } python_install_all() { diff --git a/dev-util/maturin/maturin-1.12.5.ebuild b/dev-util/maturin/maturin-1.12.5.ebuild index 8641c58221a6..22cd3da29a97 100644 --- a/dev-util/maturin/maturin-1.12.5.ebuild +++ b/dev-util/maturin/maturin-1.12.5.ebuild @@ -122,25 +122,25 @@ python_test() { # need this for (new) python versions not yet recognized by pyo3 local -x PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 - local skip=( + local skip_tests=( # picky cli output test that easily benignly fail (bug #937992) - --skip cli_tests + cli_tests # avoid need for wasm over a single hello world test - --skip integration_wasm_hello_world + integration_wasm_hello_world # fragile depending on rust version, also wants libpypy*-c.so for pypy - --skip pyo3_no_extension_module + pyo3_no_extension_module # unimportant tests that require uv, and not obvious to get it # to work with network-sandbox (not worth the trouble) - --skip develop_hello_world::case_2 - --skip develop_pyo3_ffi_pure::case_2 + develop_hello_world::case_2 + develop_pyo3_ffi_pure::case_2 # compliance test using zig requires an old libc to pass (bug #946967) - --skip integration_pyo3_mixed_py_subdir + integration_pyo3_mixed_py_subdir # these currently attempt to install tomli regardless of python version - --skip pep517_default_profile - --skip pep517_editable_profile + pep517_default_profile + pep517_editable_profile ) - cargo_src_test -- "${skip[@]}" + cargo_src_test } python_install_all() { diff --git a/dev-util/maturin/maturin-1.12.6.ebuild b/dev-util/maturin/maturin-1.12.6.ebuild index 8641c58221a6..22cd3da29a97 100644 --- a/dev-util/maturin/maturin-1.12.6.ebuild +++ b/dev-util/maturin/maturin-1.12.6.ebuild @@ -122,25 +122,25 @@ python_test() { # need this for (new) python versions not yet recognized by pyo3 local -x PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 - local skip=( + local skip_tests=( # picky cli output test that easily benignly fail (bug #937992) - --skip cli_tests + cli_tests # avoid need for wasm over a single hello world test - --skip integration_wasm_hello_world + integration_wasm_hello_world # fragile depending on rust version, also wants libpypy*-c.so for pypy - --skip pyo3_no_extension_module + pyo3_no_extension_module # unimportant tests that require uv, and not obvious to get it # to work with network-sandbox (not worth the trouble) - --skip develop_hello_world::case_2 - --skip develop_pyo3_ffi_pure::case_2 + develop_hello_world::case_2 + develop_pyo3_ffi_pure::case_2 # compliance test using zig requires an old libc to pass (bug #946967) - --skip integration_pyo3_mixed_py_subdir + integration_pyo3_mixed_py_subdir # these currently attempt to install tomli regardless of python version - --skip pep517_default_profile - --skip pep517_editable_profile + pep517_default_profile + pep517_editable_profile ) - cargo_src_test -- "${skip[@]}" + cargo_src_test } python_install_all() { diff --git a/dev-vcs/jj/jj-0.36.0.ebuild b/dev-vcs/jj/jj-0.36.0.ebuild index 669db16efb8a..f21788755ddb 100644 --- a/dev-vcs/jj/jj-0.36.0.ebuild +++ b/dev-vcs/jj/jj-0.36.0.ebuild @@ -1,4 +1,4 @@ -# Copyright 2025 Gentoo Authors +# Copyright 2025-2026 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # Autogenerated by pycargoebuild 0.15.0 @@ -41,17 +41,14 @@ DOCS=( ) src_test() { - local -a cargo_skip_tests=( + local skip_tests=( # skip tests that fail in sandbox environment test_gpg::gpgsm_signing_roundtrip test_gpg::gpgsm_signing_roundtrip_explicit_key test_gpg::gpgsm_unknown_key ) - local -a skip_params - readarray -t skip_params < <(printf -- '--skip\n%s\n' "${cargo_skip_tests[@]}") - - cargo_src_test -- "${skip_params[@]}" + cargo_src_test } src_install() { diff --git a/dev-vcs/jj/jj-0.37.0.ebuild b/dev-vcs/jj/jj-0.37.0.ebuild index 96850fadbc66..00027decb88a 100644 --- a/dev-vcs/jj/jj-0.37.0.ebuild +++ b/dev-vcs/jj/jj-0.37.0.ebuild @@ -41,17 +41,14 @@ DOCS=( ) src_test() { - local -a cargo_skip_tests=( + local skip_tests=( # skip tests that fail in sandbox environment test_gpg::gpgsm_signing_roundtrip test_gpg::gpgsm_signing_roundtrip_explicit_key test_gpg::gpgsm_unknown_key ) - local -a skip_params - readarray -t skip_params < <(printf -- '--skip\n%s\n' "${cargo_skip_tests[@]}") - - cargo_src_test -- "${skip_params[@]}" + cargo_src_test } src_install() { diff --git a/dev-vcs/jj/jj-0.38.0.ebuild b/dev-vcs/jj/jj-0.38.0.ebuild index 96850fadbc66..00027decb88a 100644 --- a/dev-vcs/jj/jj-0.38.0.ebuild +++ b/dev-vcs/jj/jj-0.38.0.ebuild @@ -41,17 +41,14 @@ DOCS=( ) src_test() { - local -a cargo_skip_tests=( + local skip_tests=( # skip tests that fail in sandbox environment test_gpg::gpgsm_signing_roundtrip test_gpg::gpgsm_signing_roundtrip_explicit_key test_gpg::gpgsm_unknown_key ) - local -a skip_params - readarray -t skip_params < <(printf -- '--skip\n%s\n' "${cargo_skip_tests[@]}") - - cargo_src_test -- "${skip_params[@]}" + cargo_src_test } src_install() { diff --git a/dev-vcs/jj/jj-0.39.0.ebuild b/dev-vcs/jj/jj-0.39.0.ebuild index 96850fadbc66..00027decb88a 100644 --- a/dev-vcs/jj/jj-0.39.0.ebuild +++ b/dev-vcs/jj/jj-0.39.0.ebuild @@ -41,17 +41,14 @@ DOCS=( ) src_test() { - local -a cargo_skip_tests=( + local skip_tests=( # skip tests that fail in sandbox environment test_gpg::gpgsm_signing_roundtrip test_gpg::gpgsm_signing_roundtrip_explicit_key test_gpg::gpgsm_unknown_key ) - local -a skip_params - readarray -t skip_params < <(printf -- '--skip\n%s\n' "${cargo_skip_tests[@]}") - - cargo_src_test -- "${skip_params[@]}" + cargo_src_test } src_install() { diff --git a/net-analyzer/rustscan/rustscan-2.4.1.ebuild b/net-analyzer/rustscan/rustscan-2.4.1.ebuild index cb374b1f8422..02a366d48342 100644 --- a/net-analyzer/rustscan/rustscan-2.4.1.ebuild +++ b/net-analyzer/rustscan/rustscan-2.4.1.ebuild @@ -1,4 +1,4 @@ -# Copyright 2025 Gentoo Authors +# Copyright 2025-2026 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # Autogenerated by pycargoebuild 0.13.4 @@ -297,13 +297,13 @@ RDEPEND="nmap? ( net-analyzer/nmap )" src_test() { # those tests require the network if has network-sandbox ${FEATURES} ; then - local skip=( - --skip address::tests::parse_correct_host_addresses - --skip address::tests::parse_hosts_file_and_incorrect_hosts - --skip address::tests::resolver_args_google_dns - --skip address::tests::resolver_default_cloudflare + local skip_tests=( + address::tests::parse_correct_host_addresses + address::tests::parse_hosts_file_and_incorrect_hosts + address::tests::resolver_args_google_dns + address::tests::resolver_default_cloudflare ) fi - cargo_src_test -- "${skip[@]}" + cargo_src_test } diff --git a/net-misc/hurl/hurl-7.0.0.ebuild b/net-misc/hurl/hurl-7.0.0.ebuild index 1f0ddd23e345..140ddbd7fefd 100644 --- a/net-misc/hurl/hurl-7.0.0.ebuild +++ b/net-misc/hurl/hurl-7.0.0.ebuild @@ -1,4 +1,4 @@ -# Copyright 2023-2025 Gentoo Authors +# Copyright 2023-2026 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # Autogenerated by pycargoebuild 0.10 @@ -238,7 +238,9 @@ src_install() { src_test() { # These need a local HTTP server.. and don't bother setting one up.. - cargo_src_test -- \ - --skip simple_sample \ - --skip runner::hurl_file::run + local skip_tests=( + simple_sample + runner::hurl_file::run + ) + cargo_src_test } diff --git a/sys-process/below/below-0.11.0-r1.ebuild b/sys-process/below/below-0.11.0-r1.ebuild index 03d1db500346..2acab31c0aaa 100644 --- a/sys-process/below/below-0.11.0-r1.ebuild +++ b/sys-process/below/below-0.11.0-r1.ebuild @@ -1,4 +1,4 @@ -# Copyright 2023-2025 Gentoo Authors +# Copyright 2023-2026 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -304,14 +304,14 @@ src_configure() { } src_test() { - local skip=( - --skip disable_disk_stat - --skip advance_forward_and_reverse - --skip disable_io_stat - --skip record_replay_integration - --skip test_belowrc_to_event + local skip_tests=( + disable_disk_stat + advance_forward_and_reverse + disable_io_stat + record_replay_integration + test_belowrc_to_event ) - cargo_src_test --workspace below -- "${skip[@]}" + cargo_src_test --workspace below } src_install() { --------------2.53.0--
