summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* eclass/tests/dist-kernel-utils.sh: add compressed_module_cleanup testsAndrew Ammerlaan2024-08-071-0/+59
| | | | | | Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/37985 Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
* eclass/tests/tests-common.sh: add in_iuse functionAndrew Ammerlaan2024-08-071-0/+2
| | | | Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
* eclass/tests/toolchain-funcs.sh: Cover tc-has-64bit-time_tMichał Górny2024-08-061-0/+20
| | | | | | Signed-off-by: Michał Górny <mgorny@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/37142 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* eclass/tests/toolchain-funcs.sh: Cover tc-is-ltoMichał Górny2024-08-061-0/+20
| | | | | | Signed-off-by: Michał Górny <mgorny@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/37976 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* llvm-r1.eclass: Update tests for new stableMichał Górny2024-07-291-9/+17
| | | | | Closes: https://bugs.gentoo.org/936882 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* eclass/tests: Include tests in version-funcs.sh itselfUlrich Müller2024-07-283-175/+175
| | | | | | Previously, tests were in eapi7-ver.sh. Update Makefile. Signed-off-by: Ulrich Müller <ulm@gentoo.org>
* eclass/tests: Fail the .%.sh.ok Makefile recipe if the test failsUlrich Müller2024-06-131-3/+5
| | | | | | | With .ONESHELL active, only the return status of the final recipe line will be checked. Signed-off-by: Ulrich Müller <ulm@gentoo.org>
* eclass/tests: Filter version-funcs.sh from the list of testsUlrich Müller2024-06-131-1/+1
| | | | | Fixes: 16b2c5ebb2869f4132536e5eb0a465b534556fb6 Signed-off-by: Ulrich Müller <ulm@gentoo.org>
* eclass/tests: Update rebar_*.sh to EAPI 8Ulrich Müller2024-06-133-6/+10
| | | | Signed-off-by: Ulrich Müller <ulm@gentoo.org>
* eclass/tests: Rename test function in savedconfig.shUlrich Müller2024-06-131-8/+14
| | | | | | | | | | | Overriding a shell builtin command is generally a very bad idea, especially when that command is used in code that is sourced (in this case, /lib/gentoo/functions.sh). Therefore, rename test() to test_sc(). Also make sure that the directories that are used as targets for rm -rf in cleanup() are actually different from the root directory. Signed-off-by: Ulrich Müller <ulm@gentoo.org>
* eclass/tests: Drop FreeBSD test from toolchain-funcs.shUlrich Müller2024-06-121-2/+2
| | | | | | | | | Prefix targets have been dropped from toolchain-funcs.eclass in commit cab79611b07c9eb. Update tests accordingly. Fixes: cab79611b07c9ebb795c6f65562ef72ba77550b1 Closes: https://bugs.gentoo.org/934150 Signed-off-by: Ulrich Müller <ulm@gentoo.org>
* eclass/tests: Remove git-r3.shMichał Górny2024-06-121-208/+0
| | | | | | | | | Remove base git-r3 tests, they are broken for a long time and I can't figure out how to fix them properly. There is probably no point in testing these functions standalone anyway since they're extensively used by ebuilds. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* eclass/tests: Make *-bench.sh work with reference dcUlrich Müller2024-06-123-6/+6
| | | | | | | dc from sys-devel/bc doesn't support the -S option. Set the precision with the k command instead. Signed-off-by: Ulrich Müller <ulm@gentoo.org>
* eclass/tests: Override use() in linux-info_get_running_version.shUlrich Müller2024-06-121-2/+10
| | | | | | | | linux-info.eclass checks for the kernel_linux flag since 2018, introduced with commit 9e7c4b6d2daa9a8b1c33154f8dd296a2d1a26e92. Closes: https://bugs.gentoo.org/934130 Signed-off-by: Ulrich Müller <ulm@gentoo.org>
* eclass/tests: Copy code from eapi7-ver.eclass to version-functions.shUlrich Müller2024-05-255-157/+309
| | | | | | | With EAPI 6 banned, eapi7-ver.eclass will be removed in the foreseeable future. Copy its code because it is still needed for tests. Signed-off-by: Ulrich Müller <ulm@gentoo.org>
* edo.eclass: enhance edob for usage with noisy commandsFlorian Schmaus2024-05-141-0/+113
| | | | | | | | | | | | | | | | | Normally, edob can, or rather should, not be used with noisy commands, i.e., commands that produce an output. This is because the output destroys the concept of ebegin and eend, where the eend marker is shown on the same line that is produced by ebegin. However, it sometimes would be nice to use edob with noisy commands, but this means to redirect stdout and stderr of those commands. Instead of redirecting the output to /dev/null, we save the output in a log file under T. This allows us to present the output to the user in case the command fails, making it furthermore part of the build.log, which we expect users to attach to bug reports. Closes: https://github.com/gentoo/gentoo/pull/36117 Signed-off-by: Florian Schmaus <flow@gentoo.org>
* eclass/tests/python-utils-r1.sh: Fix pypy3 matchesMichał Górny2024-05-081-1/+1
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Add python3_13Michał Górny2024-05-081-1/+1
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* llvm-r1.eclass: Initial versionMichał Górny2024-02-101-0/+151
| | | | | | | | Bug: https://bugs.gentoo.org/923228 Bug: https://bugs.gentoo.org/880671 Closes: https://bugs.gentoo.org/821955 Closes: https://bugs.gentoo.org/919150 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* llvm-utils.eclass: Fix llvm_prepend_path to avoid duplicatesMichał Górny2024-02-101-0/+12
| | | | | | | | | | Fix llvm_prepend_path() not to append the new path multiple times, if the original PATH variable contained multiple LLVM directories. Thanks to Alexander Miller who spotted it in: https://github.com/gentoo/gentoo/pull/35196#discussion_r1480330001 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* llvm-utils.eclass: Split out PATH prepending logicMichał Górny2024-02-101-0/+24
| | | | | | | Split the logic prepending PATH from pkg_setup() into a dedicated llvm_prepend_path() function. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* llvm-utils.eclass: Introduce an eclass for common helpersMichał Górny2024-02-101-0/+82
| | | | | | | | Move some reusable functions from llvm.eclass to llvm-utils.eclass. This is with minimal modifications so far (only argument checks were cleaned up). Signed-off-by: Michał Górny <mgorny@gentoo.org>
* eclass/tests: Remove obsolete/broken distutils-r1 testsMichał Górny2023-11-032-264/+0
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* multiprocessing.eclass: consider (GNU)MAKEFLAGS, add get_makeopts_{jobs,loadavg}Florian Schmaus2023-10-091-2/+22
| | | | | | | | | | | | | Since --load-average may not be found in other Make implementations besides GNU Make, it is potentially found in GNUMAKEFLAGS and not in MAKEOPTS. Also, Portage is probably soon setting --load-average in GNUMAKEFLAGS as default. Thanks to floppym and mgorny for feedback. Signed-off-by: Florian Schmaus <flow@gentoo.org>
* verify-sig.eclass: Fix handling multiple/duplicate signaturesMichał Górny2023-09-141-0/+11
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* verify-sig.eclass: Support `openssl dgst` format checksumsMichał Górny2023-09-141-0/+18
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* eclass/tests: Add initial tests for verify-sigMichał Górny2023-09-141-0/+65
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: make pypy3 match Python 3.10 nowMichał Górny2023-07-021-1/+1
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* cargo.eclass: Support separating crate names/versions via `@`Michał Górny2023-06-181-53/+58
| | | | | | | | | | | | | | | | | | Support specifying crate names and versions separated by `@` character rather than `-`. Since `@` are not valid in crate names, this makes splitting the tokens trivial and free of regular expressions. Effectively, the `@` variant is roughly 180% faster: ``` * CRATES with '@' separator real 952 it/s user 952 it/s * CRATES with '-' separator real 339 it/s user 339 it/s ``` Signed-off-by: Michał Górny <mgorny@gentoo.org>
* cargo.eclass: Add variable alternative to $(cargo_crate_uris)Michał Górny2023-06-181-1/+3
| | | | | | | | | | | | | Add a helper function that sets ${CARGO_CRATE_URIS} variable to make it possible to set SRC_URI without subshells. This gives a slight speedup (~20%): ``` real 300 it/s user 324 it/s ``` Signed-off-by: Michał Górny <mgorny@gentoo.org>
* eclass/tests: Add a minimal benchmark for cargo.eclassMichał Górny2023-06-181-0/+107
| | | | | | | | | | | The initial results on my machine are: ``` real 252 it/s user 289 it/s ``` Signed-off-by: Michał Górny <mgorny@gentoo.org>
* eclass/tests: Add a benchmark for python-utils-r1Michał Górny2023-06-171-0/+53
| | | | | | | | | | | | Initial timings on my system: ``` * Timing _python_set_impls real 1463 it/s user 1886 it/s ``` Signed-off-by: Michał Górny <mgorny@gentoo.org>
* eclass/tests: Add pypi-bench.sh for global scope logicMichał Górny2023-06-151-0/+69
| | | | | | The benchmark yield roughly 327 ops / s on my machine. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* eapi8-dosym.eclass: Fix another corner case of strange inputUlrich Müller2023-06-071-0/+1
| | | | Signed-off-by: Ulrich Müller <ulm@gentoo.org>
* eapi8-dosym.eclass: Don't add a spurious newline to the pathUlrich Müller2023-06-071-1/+3
| | | | | | | | | | Bash's <<< operator will append a newline to the string, therefore use echo -n instead. Add a couple of test cases that would have caught this. Fixes: d5638e49ee79c0f7e4672d5537e97a4ccc7f2eb2 Signed-off-by: Ulrich Müller <ulm@gentoo.org>
* eclass/tests/python-utils-r1.sh: Fix patterns for pypy3.10Michał Górny2023-05-231-2/+2
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Add python3_12 targetMichał Górny2023-05-231-1/+7
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* eclass/tests: add Makefile to run eclass testsFlorian Schmaus2023-05-151-0/+27
| | | | | | | Thanks to robbat2 for providing feedback. Closes: https://github.com/gentoo/gentoo/pull/30603 Signed-off-by: Florian Schmaus <flow@gentoo.org>
* eclass/tests/python-utils-r1.sh: Stop testing python3_9Michał Górny2023-05-011-7/+1
| | | | | Signed-off-by: Michał Górny <mgorny@gentoo.org> Signed-off-by: Sam James <sam@gentoo.org>
* eclass/tests: partially fix toolchain.eclass testsSam James2023-04-211-20/+21
| | | | | | | | | | - Use the same hack as in crossdev for now wrt EAPI. - Fix up the version tests. We still need to investigate the issues with -march downgrading though. Bug: https://bugs.gentoo.org/859157 Signed-off-by: Sam James <sam@gentoo.org>
* pypi.eclass: Introduce PYPI_PN to override the default project nameMichał Górny2023-03-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a convenience PYPI_PN variable that can be used to override the default project name. This is meant to be used primarily when upstream project name does not conform to Gentoo package naming rules, e.g. contains dots or uppercase letters. For example, instead of: SRC_URI="$(pypi_sdist_url --no-normalize "${PN/-/.}")" S=${WORKDIR}/${P/-/.} one can now specify: PYPI_NO_NORMALIZE=1 PYPI_PN=${PN/-/.} For PEP 625-conformant packages, instead of: SRC_URI="$(pypi_sdist_url "${PN/-/.}")" one can use: PYPI_PN=${PN/-/.} There's not much gain space-wise but it avoids having to specify the name twice. This can particularly be helpful for package names using PascalCase. Closes: https://github.com/gentoo/gentoo/pull/30210 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* eclass: standardize prologue/epilogueDavid Seifert2023-03-172-2/+2
| | | | | Closes: https://github.com/gentoo/gentoo/pull/30061 Signed-off-by: David Seifert <soap@gentoo.org>
* pypi.eclass: Normalize PN and translate PV for S as wellMichał Górny2023-02-121-0/+3
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* pypi.eclass: Translate ${PV} by defaultMichał Górny2023-02-121-12/+12
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* pypi.eclass: Add a version translation functionMichał Górny2023-02-121-0/+7
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* pypi.eclass: Normalize sdist filenames by defaultMichał Górny2023-02-121-3/+24
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* pypi.eclass: Normalize wheel filenamesMichał Górny2023-02-121-0/+33
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* pypi.eclass: Add a name normalization functionMichał Górny2023-02-121-0/+32
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: remove py3.8David Seifert2023-01-141-7/+10
| | | | Signed-off-by: David Seifert <soap@gentoo.org>
* llvm.eclass: Remove EAPI 6Michał Górny2022-12-241-7/+0
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>