* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2015-11-11 10:27 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2015-11-11 10:27 UTC (permalink / raw
To: gentoo-commits
commit: 22660bcdd3c8aea97dc22ebb681b4789bbae0d82
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 8 08:37:04 2015 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Nov 11 10:20:51 2015 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=22660bcd
python-utils-r1.eclass: Switch tests to use python3.4
Use Python 3.4 during tests since Python 3.3 is now deprecated and is
less likely to be installed on user's systems and some tests will
require Python installed.
eclass/tests/python-utils-r1.sh | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh
index e49636a..bd05e9e 100755
--- a/eclass/tests/python-utils-r1.sh
+++ b/eclass/tests/python-utils-r1.sh
@@ -69,13 +69,13 @@ test_var PYTHON_LIBPATH python2_7 /usr/lib/libpython2.7$(get_libname)
test_var PYTHON_PKG_DEP python2_7 '*dev-lang/python*:2.7'
test_var PYTHON_SCRIPTDIR python2_7 /usr/lib/python-exec/python2.7
-test_var EPYTHON python3_3 python3.3
-test_var PYTHON python3_3 /usr/bin/python3.3
-test_var PYTHON_SITEDIR python3_3 /usr/lib/python3.3/site-packages
-test_var PYTHON_INCLUDEDIR python3_3 /usr/include/python3.3
-test_var PYTHON_LIBPATH python3_3 /usr/lib/libpython3.3$(get_libname)
-test_var PYTHON_PKG_DEP python3_3 '*dev-lang/python*:3.3'
-test_var PYTHON_SCRIPTDIR python3_3 /usr/lib/python-exec/python3.3
+test_var EPYTHON python3_4 python3.4
+test_var PYTHON python3_4 /usr/bin/python3.4
+test_var PYTHON_SITEDIR python3_4 /usr/lib/python3.4/site-packages
+test_var PYTHON_INCLUDEDIR python3_4 /usr/include/python3.4
+test_var PYTHON_LIBPATH python3_4 /usr/lib/libpython3.4$(get_libname)
+test_var PYTHON_PKG_DEP python3_4 '*dev-lang/python*:3.4'
+test_var PYTHON_SCRIPTDIR python3_4 /usr/lib/python-exec/python3.4
test_var EPYTHON jython2_7 jython2.7
test_var PYTHON jython2_7 /usr/bin/jython2.7
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2015-11-12 16:03 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2015-11-12 16:03 UTC (permalink / raw
To: gentoo-commits
commit: 0edbc0e4414895801dfdb9aa436cf18e9567f4ca
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 12 15:35:13 2015 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Nov 12 16:03:16 2015 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0edbc0e4
python-utils-r1.eclass: Fix pypy3 include path in tests
eclass/tests/python-utils-r1.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh
index b683c51..b89acfd 100755
--- a/eclass/tests/python-utils-r1.sh
+++ b/eclass/tests/python-utils-r1.sh
@@ -105,7 +105,7 @@ test_var EPYTHON pypy3 pypy3
test_var PYTHON pypy3 /usr/bin/pypy3
if [[ -x /usr/bin/pypy3 ]]; then
test_var PYTHON_SITEDIR pypy3 "/usr/lib*/pypy3/site-packages"
- test_var PYTHON_INCLUDEDIR pypy3 /usr/lib/pypy3/include
+ test_var PYTHON_INCLUDEDIR pypy3 "/usr/lib*/pypy3/include"
fi
test_var PYTHON_PKG_DEP pypy3 '*virtual/pypy3*:0='
test_var PYTHON_SCRIPTDIR pypy3 /usr/lib/python-exec/pypy3
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2015-11-21 19:58 Ulrich Müller
0 siblings, 0 replies; 94+ messages in thread
From: Ulrich Müller @ 2015-11-21 19:58 UTC (permalink / raw
To: gentoo-commits
commit: 31969ba303b5aec66b74c1beec197289db10c2e2
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 21 19:56:58 2015 +0000
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sat Nov 21 19:56:58 2015 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=31969ba3
eclass/tests: Add standard header to eutils_eshopts.sh.
Acknowledged by vapier in bug 548984.
eclass/tests/eutils_eshopts.sh | 3 +++
1 file changed, 3 insertions(+)
diff --git a/eclass/tests/eutils_eshopts.sh b/eclass/tests/eutils_eshopts.sh
index 65dc89c..6d07094 100755
--- a/eclass/tests/eutils_eshopts.sh
+++ b/eclass/tests/eutils_eshopts.sh
@@ -1,4 +1,7 @@
#!/bin/bash
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
source tests-common.sh
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2015-12-09 20:42 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2015-12-09 20:42 UTC (permalink / raw
To: gentoo-commits
commit: 682cbe4bad17a57a269ee09c99fecc03ca349390
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 9 19:22:32 2015 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Dec 9 20:41:16 2015 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=682cbe4b
python-utils-r1.eclass tests: Fix to ensure PYTHON for python_export
eclass/tests/python-utils-r1.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh
index 922b690..b4ee785 100755
--- a/eclass/tests/python-utils-r1.sh
+++ b/eclass/tests/python-utils-r1.sh
@@ -14,7 +14,7 @@ test_var() {
tbegin "${var} for ${impl}"
local ${var}
- python_export ${impl} ${var}
+ python_export ${impl} PYTHON ${var}
[[ ${!var} == ${expect} ]] || eerror "(${impl}: ${var}: ${!var} != ${expect}"
tend ${?}
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2016-01-08 5:14 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2016-01-08 5:14 UTC (permalink / raw
To: gentoo-commits
commit: 5844fcae98ccc4d28aa1709fe1783b4232dac6ff
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 1 13:09:37 2016 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jan 8 05:14:36 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5844fcae
scons-utils.eclass: tests, be more verbose on tests being performed
eclass/tests/scons-utils.sh | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/eclass/tests/scons-utils.sh b/eclass/tests/scons-utils.sh
index 5a65fbe..7387135 100755
--- a/eclass/tests/scons-utils.sh
+++ b/eclass/tests/scons-utils.sh
@@ -8,7 +8,9 @@ source tests-common.sh
inherit scons-utils
test-scons_clean_makeopts() {
- local sconsopts=$(scons_clean_makeopts ${1})
+ tbegin "scons_clean_makeopts() for ${1}"
+
+ local sconsopts=$(scons_clean_makeopts ${1}) ret=0
if [[ ${sconsopts} != ${2-${1}} ]]; then
eerror "Self-test failed:"
@@ -17,11 +19,11 @@ test-scons_clean_makeopts() {
eerror "Expected: ${2-${1}}"
eerror "Actual: ${sconsopts}"
eoutdent
- (( ++failed ))
- return 1
+ ret=1
fi
- return 0
+ tend ${ret}
+ return ${ret}
}
# jobcount expected for non-specified state
@@ -29,8 +31,6 @@ jc=5
# failed test counter
failed=0
-tbegin "scons_clean_makeopts()"
-
# sane MAKEOPTS
test-scons_clean_makeopts '--jobs=14 -k'
test-scons_clean_makeopts '--jobs=14 -k'
@@ -59,6 +59,4 @@ test-scons_clean_makeopts '--jobs funnystuff -k' "--jobs=${jc} -k"
test-scons_clean_makeopts '--jobs -l3' "--jobs=${jc}"
test-scons_clean_makeopts '-j -l3' "-j ${jc}"
-tend ${failed}
-
texit
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2016-06-27 5:58 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2016-06-27 5:58 UTC (permalink / raw
To: gentoo-commits
commit: 831e3f05df898a0d3df1bbff8914ca28f08a95cb
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 27 05:57:42 2016 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Jun 27 05:58:14 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=831e3f05
eclass/tests: Remove KV_* functions from tests-common.sh
eclass/tests/tests-common.sh | 41 -----------------------------------------
1 file changed, 41 deletions(-)
diff --git a/eclass/tests/tests-common.sh b/eclass/tests/tests-common.sh
index d3095e5..faca39d 100644
--- a/eclass/tests/tests-common.sh
+++ b/eclass/tests/tests-common.sh
@@ -65,47 +65,6 @@ has_version() {
portageq has_version / "$@"
}
-KV_major() {
- [[ -z $1 ]] && return 1
-
- local KV=$@
- echo "${KV%%.*}"
-}
-
-KV_minor() {
- [[ -z $1 ]] && return 1
-
- local KV=$@
- KV=${KV#*.}
- echo "${KV%%.*}"
-}
-
-KV_micro() {
- [[ -z $1 ]] && return 1
-
- local KV=$@
- KV=${KV#*.*.}
- echo "${KV%%[^[:digit:]]*}"
-}
-
-KV_to_int() {
- [[ -z $1 ]] && return 1
-
- local KV_MAJOR=$(KV_major "$1")
- local KV_MINOR=$(KV_minor "$1")
- local KV_MICRO=$(KV_micro "$1")
- local KV_int=$(( KV_MAJOR * 65536 + KV_MINOR * 256 + KV_MICRO ))
-
- # We make version 2.2.0 the minimum version we will handle as
- # a sanity check ... if its less, we fail ...
- if [[ ${KV_int} -ge 131584 ]] ; then
- echo "${KV_int}"
- return 0
- fi
-
- return 1
-}
-
tret=0
tbegin() {
ebegin "Testing $*"
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2017-03-08 7:35 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2017-03-08 7:35 UTC (permalink / raw
To: gentoo-commits
commit: 21cb3af58f51c3ee7d488f628eb90315f73e9650
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 8 07:33:19 2017 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Mar 8 07:35:52 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=21cb3af5
eclass/tests/python-utils-r1: update impl support status
eclass/tests/python-utils-r1.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh
index 383c9229811..414ad5c53d6 100755
--- a/eclass/tests/python-utils-r1.sh
+++ b/eclass/tests/python-utils-r1.sh
@@ -167,8 +167,10 @@ test_is "_python_impl_supported python2_6" 1
test_is "_python_impl_supported python2_7" 0
test_is "_python_impl_supported python3_1" 1
test_is "_python_impl_supported python3_2" 1
-test_is "_python_impl_supported python3_3" 0
+test_is "_python_impl_supported python3_3" 1
test_is "_python_impl_supported python3_4" 0
+test_is "_python_impl_supported python3_5" 0
+test_is "_python_impl_supported python3_6" 0
test_is "_python_impl_supported pypy1_8" 1
test_is "_python_impl_supported pypy1_9" 1
test_is "_python_impl_supported pypy2_0" 1
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2017-04-14 16:28 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2017-04-14 16:28 UTC (permalink / raw
To: gentoo-commits
commit: 16112d6d0340eb6f27a5ef0fa62274a3f90569da
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 24 20:55:26 2017 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Apr 14 16:27:51 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=16112d6d
eclass/tests/estack_eshopts.sh: Add tests for 'set' variant of eshopt*
eclass/tests/estack_eshopts.sh | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/eclass/tests/estack_eshopts.sh b/eclass/tests/estack_eshopts.sh
index 606a17cfb05..28346c65ec1 100755
--- a/eclass/tests/estack_eshopts.sh
+++ b/eclass/tests/estack_eshopts.sh
@@ -27,6 +27,29 @@ for arg in nullglob dotglob extglob ; do
done
done
+# test 'set' options
+set -f
+tbegin "set +f"
+s0=$-
+t eshopts_push +f
+s1=$-
+t eshopts_pop
+s2=$-
+[[ ${s0} == "${s2}" ]] &&
+[[ ${s1} != *f* ]]
+tend $?
+
+set +f
+tbegin "set -f"
+s0=$-
+t eshopts_push -f
+s1=$-
+t eshopts_pop
+s2=$-
+[[ ${s0} == "${s2}" ]] &&
+[[ ${s1} == *f* ]]
+tend $?
+
tbegin "multi push/pop"
s0=$(shopt -p)
t eshopts_push -s dotglob
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2017-08-08 19:42 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2017-08-08 19:42 UTC (permalink / raw
To: gentoo-commits
commit: 692442585cdb32cd8c59acab4289565614faf3b8
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 1 16:10:06 2017 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Aug 8 19:42:16 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=69244258
eclass/tests: Fix inheriting multiple eclasses
Fix the inherit function to correctly handle 'inherit' call with
multiple eclasses, instead of returning after the first eclass is
successfully sourced.
eclass/tests/tests-common.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/eclass/tests/tests-common.sh b/eclass/tests/tests-common.sh
index 8141425a0dc..d52cf3a2687 100644
--- a/eclass/tests/tests-common.sh
+++ b/eclass/tests/tests-common.sh
@@ -17,11 +17,11 @@ inherit() {
local eclass=${path}/${e}.eclass
if [[ -e "${eclass}" ]] ; then
source "${eclass}"
- return 0
+ continue 2
fi
done
+ die "could not find ${e}.eclass"
done
- die "could not find ${eclass}"
}
EXPORT_FUNCTIONS() { :; }
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2017-09-14 19:05 Mike Gilbert
0 siblings, 0 replies; 94+ messages in thread
From: Mike Gilbert @ 2017-09-14 19:05 UTC (permalink / raw
To: gentoo-commits
commit: f48f6febd88031c2e257188f0921d75d455b7abe
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 11 14:30:41 2017 +0000
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Thu Sep 14 19:05:32 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f48f6feb
multiprocessing.eclass: add tests for float values
Bug: https://bugs.gentoo.org/630626
eclass/tests/multiprocessing_makeopts_loadavg.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/eclass/tests/multiprocessing_makeopts_loadavg.sh b/eclass/tests/multiprocessing_makeopts_loadavg.sh
index a03bf0ca879..d17d7734b9f 100755
--- a/eclass/tests/multiprocessing_makeopts_loadavg.sh
+++ b/eclass/tests/multiprocessing_makeopts_loadavg.sh
@@ -15,7 +15,7 @@ test-makeopts_loadavg() {
tend 1 "Mismatch between MAKEOPTS/cli: '${indirect}' != '${direct}'"
else
[[ ${direct} == "${exp}" ]]
- tend $? "Got back: ${act}"
+ tend $? "Got back: ${direct}"
fi
}
@@ -35,6 +35,8 @@ tests=(
999 "-kl"
4 "-kl4"
5 "-kl 5"
+ 2.3 "-l 2.3"
+ 999 "-l 2.3.4"
)
for (( i = 0; i < ${#tests[@]}; i += 2 )) ; do
test-makeopts_loadavg "${tests[i]}" "${tests[i+1]}"
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2017-09-19 13:15 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2017-09-19 13:15 UTC (permalink / raw
To: gentoo-commits
commit: a54b2f4054ee68b315549356e8e4710d07067705
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 19 13:13:04 2017 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Sep 19 13:15:09 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a54b2f40
eclass/tests/eapi7-ver_benchmark: More readable average
eclass/tests/eapi7-ver_benchmark.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/eclass/tests/eapi7-ver_benchmark.sh b/eclass/tests/eapi7-ver_benchmark.sh
index 7e3c830fcb7..1de26444c9b 100755
--- a/eclass/tests/eapi7-ver_benchmark.sh
+++ b/eclass/tests/eapi7-ver_benchmark.sh
@@ -100,7 +100,7 @@ get_times() {
sum=$(dc -e "${!vr} + + + + 3 k 5 / p")
vr="${v}[@]"
- printf '%s %4.2f %4.2f %4.2f %4.2f %4.2f %4.2f\n' \
+ printf '%s %4.2f %4.2f %4.2f %4.2f %4.2f => %4.2f avg\n' \
"${v}" "${!vr}" "${sum}"
done
}
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2018-12-09 20:32 Sergei Trofimovich
0 siblings, 0 replies; 94+ messages in thread
From: Sergei Trofimovich @ 2018-12-09 20:32 UTC (permalink / raw
To: gentoo-commits
commit: aa14fce6eb06886279cb125f4a7af9352d4378d1
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 9 11:52:53 2018 +0000
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sun Dec 9 20:31:59 2018 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aa14fce6
eclass/tests/toolchain.sh: add EAPI=5 to unbreak tests
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
eclass/tests/toolchain.sh | 2 ++
1 file changed, 2 insertions(+)
diff --git a/eclass/tests/toolchain.sh b/eclass/tests/toolchain.sh
index 47401e68752..b41bf96cd03 100755
--- a/eclass/tests/toolchain.sh
+++ b/eclass/tests/toolchain.sh
@@ -2,6 +2,8 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
+EAPI=5
+
source tests-common.sh
inherit toolchain
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2018-12-09 20:32 Sergei Trofimovich
0 siblings, 0 replies; 94+ messages in thread
From: Sergei Trofimovich @ 2018-12-09 20:32 UTC (permalink / raw
To: gentoo-commits
commit: 08a01779eae0ff0566f133039c44a74a84781c5e
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 9 11:58:33 2018 +0000
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sun Dec 9 20:32:02 2018 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=08a01779
eclass/tests/toolchain.sh: prefix test name
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
eclass/tests/toolchain.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/eclass/tests/toolchain.sh b/eclass/tests/toolchain.sh
index b41bf96cd03..558a44c8771 100755
--- a/eclass/tests/toolchain.sh
+++ b/eclass/tests/toolchain.sh
@@ -16,7 +16,7 @@ test_downgrade_arch_flags() {
shift 2
CFLAGS=${@}
- tbegin "${ver} ${CFLAGS} => ${exp}"
+ tbegin "downgrade_arch_flags: ${ver} ${CFLAGS} => ${exp}"
CHOST=x86_64 # needed for tc-arch
downgrade_arch_flags ${ver}
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2018-12-09 20:32 Sergei Trofimovich
0 siblings, 0 replies; 94+ messages in thread
From: Sergei Trofimovich @ 2018-12-09 20:32 UTC (permalink / raw
To: gentoo-commits
commit: 61f0a9c777bbad70575e63699cbde914bcf4a90f
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 9 12:47:23 2018 +0000
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sun Dec 9 20:32:03 2018 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=61f0a9c7
eclass/tests/toolchain.sh: add tests to prepare to eapi7-ver switch
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
eclass/tests/toolchain.sh | 91 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 91 insertions(+)
diff --git a/eclass/tests/toolchain.sh b/eclass/tests/toolchain.sh
index 558a44c8771..ec225356856 100755
--- a/eclass/tests/toolchain.sh
+++ b/eclass/tests/toolchain.sh
@@ -4,6 +4,10 @@
EAPI=5
+# apply exlass globals to test version parsing
+TOOLCHAIN_GCC_PV=7.3.0
+PR=r0
+
source tests-common.sh
inherit toolchain
@@ -81,4 +85,91 @@ test_downgrade_arch_flags 4.3 "-march=foo -mno-sse4.1" "-march=foo -mno-sha -mno
test_downgrade_arch_flags 4.2 "-march=foo" "-march=foo -mno-sha -mno-rtm -mno-avx2 -mno-avx -mno-sse4.1"
test_downgrade_arch_flags 4.4 "-O2 -march=core2 -ffoo -fblah" "-O2 -march=atom -mno-sha -ffoo -mno-rtm -fblah"
+
+# basic version parsing tests in preparation to eapi7-ver switch
+
+test_tc_version_is_at_least() {
+ local exp msg ret=0 want mine res
+
+ want=${1}
+ mine=${2}
+ exp=${3}
+
+ tbegin "tc_version_is_at_least: ${want} ${mine} => ${exp}"
+
+ tc_version_is_at_least ${want} ${mine}
+ res=$?
+
+ if [[ ${res} -ne ${exp} ]]; then
+ msg="Failure - Expected: \"${exp}\" Got: \"${res}\""
+ ret=1
+ fi
+ tend ${ret} ${msg}
+}
+
+# want mine expect
+test_tc_version_is_at_least 8 '' 1
+test_tc_version_is_at_least 8.0 '' 1
+test_tc_version_is_at_least 7 '' 0
+test_tc_version_is_at_least 7.0 '' 0
+test_tc_version_is_at_least ${TOOLCHAIN_GCC_PV} '' 0
+test_tc_version_is_at_least 5.0 6.0 0
+
+test_tc_version_is_between() {
+ local exp msg ret=0 lo hi res
+
+ lo=${1}
+ hi=${2}
+ exp=${3}
+
+ tbegin "tc_version_is_between: ${lo} ${hi} => ${exp}"
+
+ tc_version_is_between ${lo} ${hi}
+ res=$?
+
+ if [[ ${res} -ne ${exp} ]]; then
+ msg="Failure - Expected: \"${exp}\" Got: \"${res}\""
+ ret=1
+ fi
+ tend ${ret} ${msg}
+}
+
+# lo hi expect
+test_tc_version_is_between 1 0 1
+test_tc_version_is_between 1 2 1
+test_tc_version_is_between 7 8 0
+test_tc_version_is_between ${TOOLCHAIN_GCC_PV} 8 0
+test_tc_version_is_between ${TOOLCHAIN_GCC_PV} ${TOOLCHAIN_GCC_PV} 1
+test_tc_version_is_between 7 ${TOOLCHAIN_GCC_PV} 1
+test_tc_version_is_between 8 9 1
+
+# eclass has a few critical global variables worth not breaking
+test_var_assert() {
+ local var_name exp
+
+ var_name=${1}
+ exp=${2}
+
+ tbegin "asserv variable value: ${var_name} => ${exp}"
+
+ if [[ ${!var_name} != ${exp} ]]; then
+ msg="Failure - Expected: \"${exp}\" Got: \"${!var_name}\""
+ ret=1
+ fi
+ tend ${ret} ${msg}
+}
+
+# TODO: convert these globals to helpers to ease testing against multiple
+# ${TOOLCHAIN_GCC_PV} vaues.
+test_var_assert GCC_PV 7.3.0
+test_var_assert GCC_PVR 7.3.0
+test_var_assert GCC_RELEASE_VER 7.3.0
+test_var_assert GCC_BRANCH_VER 7.3
+test_var_assert GCCMAJOR 7
+test_var_assert GCCMINOR 3
+test_var_assert GCCMICRO 0
+test_var_assert BRANCH_UPDATE ''
+test_var_assert GCC_CONFIG_VER 7.3.0
+test_var_assert PREFIX /usr
+
texit
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2019-11-06 22:44 Sergei Trofimovich
0 siblings, 0 replies; 94+ messages in thread
From: Sergei Trofimovich @ 2019-11-06 22:44 UTC (permalink / raw
To: gentoo-commits
commit: 8f02136721af40dd89a09101504750fb28f8142e
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 6 22:40:18 2019 +0000
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Wed Nov 6 22:44:34 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8f021367
eclass/tests/toolchain-funcs.sh add test for 'tc-cpp-is-true()'
With patch from bug #698912 reverted we observe failures as:
* Testing tc-cpp-is-true (gcc, defined) ... [ ok ]
* Testing tc-cpp-is-true (gcc, not defined) ... [ ok ]
* Testing tc-cpp-is-true (gcc, defined on -ggdb3) ... [ !! ]
* Testing tc-cpp-is-true (clang, defined) ... [ !! ]
* Testing tc-cpp-is-true (clang, not defined) ... [ ok ]
* Testing tc-cpp-is-true (clang, defined on -ggdb3) ... [ !! ]
Closes: https://bugs.gentoo.org/698912
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
eclass/tests/toolchain-funcs.sh | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/eclass/tests/toolchain-funcs.sh b/eclass/tests/toolchain-funcs.sh
index bcf57f78201..79ba6fa407b 100755
--- a/eclass/tests/toolchain-funcs.sh
+++ b/eclass/tests/toolchain-funcs.sh
@@ -172,4 +172,28 @@ if type -P pathcc &>/dev/null; then
tend $?
fi
+for compiler in gcc clang; do
+ if type -P ${compielr} &>/dev/null; then
+ tbegin "tc-cpp-is-true ($compiler, defined)"
+ (
+ export CC=${compiler}
+ tc-cpp-is-true "defined(SOME_DEFINED_SYMBOL)" -DSOME_DEFINED_SYMBOL
+ )
+ tend $?
+ tbegin "tc-cpp-is-true ($compiler, not defined)"
+ (
+ export CC=${compiler}
+ ! tc-cpp-is-true "defined(SOME_UNDEFINED_SYMBOL)"
+ )
+ tend $?
+
+ tbegin "tc-cpp-is-true ($compiler, defined on -ggdb3)"
+ (
+ export CC=${compiler}
+ tc-cpp-is-true "defined(SOME_DEFINED_SYMBOL)" -DSOME_DEFINED_SYMBOL -ggdb3
+ )
+ tend $?
+ fi
+done
+
texit
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2019-11-20 7:47 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2019-11-20 7:47 UTC (permalink / raw
To: gentoo-commits
commit: dab1b0137f4fd5f91dab6dafe8a4c130a28290f3
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 15 16:34:45 2019 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Nov 20 07:44:04 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dab1b013
distutils-r1.eclass: Add tests for distutils_enable_tests
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/distutils-r1.sh | 67 +++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 66 insertions(+), 1 deletion(-)
diff --git a/eclass/tests/distutils-r1.sh b/eclass/tests/distutils-r1.sh
index d557f6cad53..d5f3e2812ca 100755
--- a/eclass/tests/distutils-r1.sh
+++ b/eclass/tests/distutils-r1.sh
@@ -17,6 +17,36 @@ test-phase_name_free() {
fi
}
+test-distutils_enable_tests() {
+ local runner=${1}
+ local exp_IUSE=${2}
+ local exp_RESTRICT=${3}
+ local exp_DEPEND=${4}
+
+ local IUSE=${IUSE}
+ local RESTRICT=${RESTRICT}
+ local DEPEND=${DEPEND}
+
+ tbegin "${runner}"
+
+ distutils_enable_tests "${runner}"
+
+ local ret var
+ for var in IUSE RESTRICT DEPEND; do
+ local exp_var=exp_${var}
+ if [[ ${!var} != "${!exp_var}" ]]; then
+ eindent
+ eerror "${var} expected: ${!exp_var}"
+ eerror "${var} actual: ${!var}"
+ eoutdent
+ ret=1
+ tret=1
+ fi
+ done
+
+ tend ${ret}
+}
+
inherit distutils-r1
tbegin "sane function names"
@@ -27,6 +57,41 @@ test-phase_name_free python_compile
test-phase_name_free python_test
test-phase_name_free python_install
-tend ${failed}
+tend
+
+einfo distutils_enable_tests
+eindent
+BASE_IUSE="python_targets_python2_7"
+BASE_DEPS="python_targets_python2_7? ( >=dev-lang/python-2.7.5-r2:2.7 ) >=dev-lang/python-exec-2:=[python_targets_python2_7(-)?,-python_single_target_python2_7(-)]"
+TEST_RESTRICT=" !test? ( test )"
+
+einfo "empty RDEPEND"
+eindent
+RDEPEND=""
+test-distutils_enable_tests pytest \
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( dev-python/pytest[${PYTHON_USEDEP}] )"
+test-distutils_enable_tests nose \
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( dev-python/nose[${PYTHON_USEDEP}] )"
+test-distutils_enable_tests unittest \
+ "${BASE_IUSE}" "" "${BASE_DEPS}"
+test-distutils_enable_tests setup.py \
+ "${BASE_IUSE}" "" "${BASE_DEPS}"
+eoutdent
+
+einfo "non-empty RDEPEND"
+eindent
+BASE_RDEPEND="dev-python/foo[${PYTHON_USEDEP}]"
+RDEPEND=${BASE_RDEPEND}
+test-distutils_enable_tests pytest \
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( dev-python/pytest[${PYTHON_USEDEP}] ${BASE_RDEPEND} )"
+test-distutils_enable_tests nose \
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( dev-python/nose[${PYTHON_USEDEP}] ${BASE_RDEPEND} )"
+test-distutils_enable_tests unittest \
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} )"
+test-distutils_enable_tests setup.py \
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} )"
+eoutdent
+
+eoutdent
texit
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2019-11-20 8:46 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2019-11-20 8:46 UTC (permalink / raw
To: gentoo-commits
commit: e82001e69d4c8bf11f29599ea3701d35c8d7cb52
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 20 08:43:59 2019 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Nov 20 08:46:33 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e82001e6
eclass/tests/python-utils-r1.sh: update for modern impls
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/python-utils-r1.sh | 40 +++++++++++++++++++++-------------------
1 file changed, 21 insertions(+), 19 deletions(-)
diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh
index 414ad5c53d6..3f60112a153 100755
--- a/eclass/tests/python-utils-r1.sh
+++ b/eclass/tests/python-utils-r1.sh
@@ -1,8 +1,8 @@
#!/bin/bash
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=5
+EAPI=7
source tests-common.sh
test_var() {
@@ -71,17 +71,17 @@ fi
test_var PYTHON_PKG_DEP python2_7 '*dev-lang/python*:2.7'
test_var PYTHON_SCRIPTDIR python2_7 /usr/lib/python-exec/python2.7
-test_var EPYTHON python3_4 python3.4
-test_var PYTHON python3_4 /usr/bin/python3.4
-if [[ -x /usr/bin/python3.4 ]]; then
- abiflags=$(/usr/bin/python3.4 -c 'import sysconfig; print(sysconfig.get_config_var("ABIFLAGS"))')
- test_var PYTHON_SITEDIR python3_4 "/usr/lib*/python3.4/site-packages"
- test_var PYTHON_INCLUDEDIR python3_4 "/usr/include/python3.4${abiflags}"
- test_var PYTHON_LIBPATH python3_4 "/usr/lib*/libpython3.4${abiflags}$(get_libname)"
- test_var PYTHON_CONFIG python3_4 "/usr/bin/python3.4${abiflags}-config"
+test_var EPYTHON python3_6 python3.6
+test_var PYTHON python3_6 /usr/bin/python3.6
+if [[ -x /usr/bin/python3.6 ]]; then
+ abiflags=$(/usr/bin/python3.6 -c 'import sysconfig; print(sysconfig.get_config_var("ABIFLAGS"))')
+ test_var PYTHON_SITEDIR python3_6 "/usr/lib*/python3.6/site-packages"
+ test_var PYTHON_INCLUDEDIR python3_6 "/usr/include/python3.6${abiflags}"
+ test_var PYTHON_LIBPATH python3_6 "/usr/lib*/libpython3.6${abiflags}$(get_libname)"
+ test_var PYTHON_CONFIG python3_6 "/usr/bin/python3.6${abiflags}-config"
fi
-test_var PYTHON_PKG_DEP python3_4 '*dev-lang/python*:3.4'
-test_var PYTHON_SCRIPTDIR python3_4 /usr/lib/python-exec/python3.4
+test_var PYTHON_PKG_DEP python3_6 '*dev-lang/python*:3.6'
+test_var PYTHON_SCRIPTDIR python3_6 /usr/lib/python-exec/python3.6
test_var EPYTHON jython2_7 jython2.7
test_var PYTHON jython2_7 /usr/bin/jython2.7
@@ -117,7 +117,7 @@ test_is "python_is_python3 pypy3" 0
# generic shebangs
test_fix_shebang '#!/usr/bin/python' python2.7 '#!/usr/bin/python2.7'
-test_fix_shebang '#!/usr/bin/python' python3.4 '#!/usr/bin/python3.4'
+test_fix_shebang '#!/usr/bin/python' python3.6 '#!/usr/bin/python3.6'
test_fix_shebang '#!/usr/bin/python' pypy '#!/usr/bin/pypy'
test_fix_shebang '#!/usr/bin/python' pypy3 '#!/usr/bin/pypy3'
test_fix_shebang '#!/usr/bin/python' jython2.7 '#!/usr/bin/jython2.7'
@@ -126,9 +126,9 @@ test_fix_shebang '#!/usr/bin/python' jython2.7 '#!/usr/bin/jython2.7'
test_fix_shebang '#!/usr/bin/python2' python2.7 '#!/usr/bin/python2.7'
test_fix_shebang '#!/usr/bin/python3' python2.7 FAIL
test_fix_shebang '#!/usr/bin/python3' python2.7 '#!/usr/bin/python2.7' --force
-test_fix_shebang '#!/usr/bin/python3' python3.4 '#!/usr/bin/python3.4'
-test_fix_shebang '#!/usr/bin/python2' python3.4 FAIL
-test_fix_shebang '#!/usr/bin/python2' python3.4 '#!/usr/bin/python3.4' --force
+test_fix_shebang '#!/usr/bin/python3' python3.6 '#!/usr/bin/python3.6'
+test_fix_shebang '#!/usr/bin/python2' python3.6 FAIL
+test_fix_shebang '#!/usr/bin/python2' python3.6 '#!/usr/bin/python3.6' --force
# pythonX.Y matching (those mostly test the patterns)
test_fix_shebang '#!/usr/bin/python2.7' python2.7 '#!/usr/bin/python2.7'
@@ -145,8 +145,8 @@ test_fix_shebang '#!/usr/bin/jython2.7' jython3.2 FAIL
test_fix_shebang '#!/usr/bin/jython2.7' jython3.2 '#!/usr/bin/jython3.2' --force
# fancy path handling
-test_fix_shebang '#!/mnt/python2/usr/bin/python' python3.4 \
- '#!/mnt/python2/usr/bin/python3.4'
+test_fix_shebang '#!/mnt/python2/usr/bin/python' python3.6 \
+ '#!/mnt/python2/usr/bin/python3.6'
test_fix_shebang '#!/mnt/python2/usr/bin/python2' python2.7 \
'#!/mnt/python2/usr/bin/python2.7'
test_fix_shebang '#!/mnt/python2/usr/bin/env python' python2.7 \
@@ -168,9 +168,11 @@ test_is "_python_impl_supported python2_7" 0
test_is "_python_impl_supported python3_1" 1
test_is "_python_impl_supported python3_2" 1
test_is "_python_impl_supported python3_3" 1
-test_is "_python_impl_supported python3_4" 0
+test_is "_python_impl_supported python3_4" 1
test_is "_python_impl_supported python3_5" 0
test_is "_python_impl_supported python3_6" 0
+test_is "_python_impl_supported python3_7" 0
+test_is "_python_impl_supported python3_8" 0
test_is "_python_impl_supported pypy1_8" 1
test_is "_python_impl_supported pypy1_9" 1
test_is "_python_impl_supported pypy2_0" 1
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2019-11-20 8:46 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2019-11-20 8:46 UTC (permalink / raw
To: gentoo-commits
commit: e1fe382b21691a0731b7fe1d3d13a08b1275f241
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 20 08:44:55 2019 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Nov 20 08:46:34 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e1fe382b
eclass/tests/python-utils-r1.sh: Update PyPy paths
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/python-utils-r1.sh | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh
index 3f60112a153..226eba9370e 100755
--- a/eclass/tests/python-utils-r1.sh
+++ b/eclass/tests/python-utils-r1.sh
@@ -94,8 +94,8 @@ test_var PYTHON_SCRIPTDIR jython2_7 /usr/lib/python-exec/jython2.7
test_var EPYTHON pypy pypy
test_var PYTHON pypy /usr/bin/pypy
if [[ -x /usr/bin/pypy ]]; then
- test_var PYTHON_SITEDIR pypy "/usr/lib*/pypy/site-packages"
- test_var PYTHON_INCLUDEDIR pypy "/usr/lib*/pypy/include"
+ test_var PYTHON_SITEDIR pypy "/usr/lib*/pypy2.7/site-packages"
+ test_var PYTHON_INCLUDEDIR pypy "/usr/lib*/pypy2.7/include"
fi
test_var PYTHON_PKG_DEP pypy '*virtual/pypy*:0='
test_var PYTHON_SCRIPTDIR pypy /usr/lib/python-exec/pypy
@@ -103,8 +103,8 @@ test_var PYTHON_SCRIPTDIR pypy /usr/lib/python-exec/pypy
test_var EPYTHON pypy3 pypy3
test_var PYTHON pypy3 /usr/bin/pypy3
if [[ -x /usr/bin/pypy3 ]]; then
- test_var PYTHON_SITEDIR pypy3 "/usr/lib*/pypy3/site-packages"
- test_var PYTHON_INCLUDEDIR pypy3 "/usr/lib*/pypy3/include"
+ test_var PYTHON_SITEDIR pypy3 "/usr/lib*/pypy3.?/site-packages"
+ test_var PYTHON_INCLUDEDIR pypy3 "/usr/lib*/pypy3.?/include"
fi
test_var PYTHON_PKG_DEP pypy3 '*virtual/pypy3*:0='
test_var PYTHON_SCRIPTDIR pypy3 /usr/lib/python-exec/pypy3
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2019-11-20 8:46 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2019-11-20 8:46 UTC (permalink / raw
To: gentoo-commits
commit: 6104a28be358ced4ab9bab9f11cede409de532a6
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 20 08:46:00 2019 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Nov 20 08:46:35 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6104a28b
eclass/tests/python-utils-r1.sh: Add tests for py3.7
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/python-utils-r1.sh | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh
index 226eba9370e..e7c533d5f33 100755
--- a/eclass/tests/python-utils-r1.sh
+++ b/eclass/tests/python-utils-r1.sh
@@ -83,6 +83,18 @@ fi
test_var PYTHON_PKG_DEP python3_6 '*dev-lang/python*:3.6'
test_var PYTHON_SCRIPTDIR python3_6 /usr/lib/python-exec/python3.6
+test_var EPYTHON python3_7 python3.7
+test_var PYTHON python3_7 /usr/bin/python3.7
+if [[ -x /usr/bin/python3.7 ]]; then
+ abiflags=$(/usr/bin/python3.7 -c 'import sysconfig; print(sysconfig.get_config_var("ABIFLAGS"))')
+ test_var PYTHON_SITEDIR python3_7 "/usr/lib/python3.7/site-packages"
+ test_var PYTHON_INCLUDEDIR python3_7 "/usr/include/python3.7${abiflags}"
+ test_var PYTHON_LIBPATH python3_7 "/usr/lib*/libpython3.7${abiflags}$(get_libname)"
+ test_var PYTHON_CONFIG python3_7 "/usr/bin/python3.7${abiflags}-config"
+fi
+test_var PYTHON_PKG_DEP python3_7 '*dev-lang/python*:3.7'
+test_var PYTHON_SCRIPTDIR python3_7 /usr/lib/python-exec/python3.7
+
test_var EPYTHON jython2_7 jython2.7
test_var PYTHON jython2_7 /usr/bin/jython2.7
if [[ -x /usr/bin/jython2.7 ]]; then
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2019-11-20 9:00 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2019-11-20 9:00 UTC (permalink / raw
To: gentoo-commits
commit: edd5b81e2adc156b3a9545faefcb9397c0ca63a4
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 20 08:59:36 2019 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Nov 20 08:59:49 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=edd5b81e
eclass/tests/git-r3_GIT_DIR.sh: Use a supported EAPI
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/git-r3_GIT_DIR.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/eclass/tests/git-r3_GIT_DIR.sh b/eclass/tests/git-r3_GIT_DIR.sh
index 06c4094ceb9..42bebd99782 100755
--- a/eclass/tests/git-r3_GIT_DIR.sh
+++ b/eclass/tests/git-r3_GIT_DIR.sh
@@ -1,7 +1,9 @@
#!/bin/bash
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
+EAPI=7
+
source tests-common.sh
inherit git-r3
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2019-11-20 9:00 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2019-11-20 9:00 UTC (permalink / raw
To: gentoo-commits
commit: e4c472f744ab75e15056aa2a4dcfe3c6edb2caa9
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 20 08:58:24 2019 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Nov 20 08:58:54 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e4c472f7
eclass/tests/git-r3_subrepos.sh: Use a supported EAPI
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/git-r3_subrepos.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/eclass/tests/git-r3_subrepos.sh b/eclass/tests/git-r3_subrepos.sh
index 5b814328a49..0fcf1cd0808 100755
--- a/eclass/tests/git-r3_subrepos.sh
+++ b/eclass/tests/git-r3_subrepos.sh
@@ -1,7 +1,9 @@
#!/bin/bash
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
+EAPI=7
+
source tests-common.sh
inherit git-r3
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2019-11-20 9:00 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2019-11-20 9:00 UTC (permalink / raw
To: gentoo-commits
commit: b60ffd4286d874cc61b892ac14c76ea2b14dc6cb
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 20 08:57:42 2019 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Nov 20 08:57:42 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b60ffd42
eclass/tests/git-r3.sh: Partially fix and disable
The tests rely on ext: remote support which apparently no longer works.
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/git-r3.sh | 7 ++++++-
eclass/tests/tests-common.sh | 2 ++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/eclass/tests/git-r3.sh b/eclass/tests/git-r3.sh
index 6ff6226c0aa..2f452bfd68a 100755
--- a/eclass/tests/git-r3.sh
+++ b/eclass/tests/git-r3.sh
@@ -1,7 +1,12 @@
#!/bin/bash
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
+# git no longer allows ext: protocol, meh
+exit 0
+
+EAPI=7
+
source tests-common.sh
inherit git-r3
diff --git a/eclass/tests/tests-common.sh b/eclass/tests/tests-common.sh
index d52cf3a2687..674eaa02cdc 100644
--- a/eclass/tests/tests-common.sh
+++ b/eclass/tests/tests-common.sh
@@ -103,3 +103,5 @@ PV="0"
P="${PN}-${PV}"
PF=${P}
SLOT=0
+
+addwrite() { :; }
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2019-11-20 9:15 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2019-11-20 9:15 UTC (permalink / raw
To: gentoo-commits
commit: e2992167ca894f82afa2fcdb23ff21ad4807ad37
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 20 09:14:28 2019 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Nov 20 09:15:03 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e2992167
eclass/tests/scons-utils.sh: Fix getting default job count
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/scons-utils.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/eclass/tests/scons-utils.sh b/eclass/tests/scons-utils.sh
index 7a588863c6a..873312f67d0 100755
--- a/eclass/tests/scons-utils.sh
+++ b/eclass/tests/scons-utils.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
source tests-common.sh
@@ -27,7 +27,7 @@ test-scons_clean_makeopts() {
}
# jobcount expected for non-specified state
-jc=$(_scons_get_default_jobs)
+jc=$(( $(get_nproc) + 1 ))
# failed test counter
failed=0
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2019-11-20 9:16 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2019-11-20 9:16 UTC (permalink / raw
To: gentoo-commits
commit: 7d3e32ce11e4f9137c5f26776ccf1f1258a025a8
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 20 09:15:48 2019 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Nov 20 09:15:48 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7d3e32ce
eclass/tests/savedconfig.sh: Use a supported EAPI
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/savedconfig.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/eclass/tests/savedconfig.sh b/eclass/tests/savedconfig.sh
index 19da181d840..7643cf4cc82 100755
--- a/eclass/tests/savedconfig.sh
+++ b/eclass/tests/savedconfig.sh
@@ -1,7 +1,9 @@
#!/bin/bash
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
+EAPI=7
+
source tests-common.sh
inherit savedconfig
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2019-11-20 9:23 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2019-11-20 9:23 UTC (permalink / raw
To: gentoo-commits
commit: f50c714df53bcc38a09c1cfbd6b25506dd449eb7
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 20 09:23:32 2019 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Nov 20 09:23:32 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f50c714d
eclass/tests/git-r3_GIT_DIR.sh: stub out git calls
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/git-r3_GIT_DIR.sh | 2 ++
1 file changed, 2 insertions(+)
diff --git a/eclass/tests/git-r3_GIT_DIR.sh b/eclass/tests/git-r3_GIT_DIR.sh
index 42bebd99782..c17ae7bb43c 100755
--- a/eclass/tests/git-r3_GIT_DIR.sh
+++ b/eclass/tests/git-r3_GIT_DIR.sh
@@ -15,6 +15,8 @@ cd "${testdir}" || die "unable to cd to testdir"
EGIT3_STORE_DIR=store
mkdir "${EGIT3_STORE_DIR}" || die "unable to mkdir store"
+git() { :; }
+
# Test cleaning up canonical repo URI
test_repouri() {
local uri=${1}
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2019-11-20 19:51 Sergei Trofimovich
0 siblings, 0 replies; 94+ messages in thread
From: Sergei Trofimovich @ 2019-11-20 19:51 UTC (permalink / raw
To: gentoo-commits
commit: 3b75b027410fa2f5aca262794173086ec6b19d90
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 20 19:49:35 2019 +0000
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Wed Nov 20 19:51:36 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3b75b027
eclass/tests/flag-o-matic.sh: fix strip-unsupported-flags -B* set of tests
Don't know how I tested previous state, it certainly could not work.
The fix itself is fine though. The change updates expected output.
Reported-by: Michał Górny
Bug: https://bugs.gentoo.org/687198
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
eclass/tests/flag-o-matic.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/eclass/tests/flag-o-matic.sh b/eclass/tests/flag-o-matic.sh
index 691b052c3d4..b0b97ea0bc1 100755
--- a/eclass/tests/flag-o-matic.sh
+++ b/eclass/tests/flag-o-matic.sh
@@ -63,7 +63,7 @@ CXXFLAGS="-O2 -B/foo -O1"
LDFLAGS="-O2 -B/foo -O1"
tbegin "strip-unsupported-flags for '-B/foo'"
strip-unsupported-flags
-[[ ${CFLAGS} == "-O2 -O1" ]] && [[ ${CXXFLAGS} == "-O2 -O1" ]] && [[ ${LDFLAGS} == "" ]]
+[[ ${CFLAGS} == "-O2 -B/foo -O1" ]] && [[ ${CXXFLAGS} == "-O2 -B/foo -O1" ]] && [[ ${LDFLAGS} == "-O2 -B/foo -O1" ]]
ftend
CFLAGS="-O2 -B /foo -O1"
@@ -71,7 +71,7 @@ CXXFLAGS="-O2 -B /foo -O1"
LDFLAGS="-O2 -B /foo -O1"
tbegin "strip-unsupported-flags for '-B /foo'"
strip-unsupported-flags
-[[ ${CFLAGS} == "-O2 -O1" ]] && [[ ${CXXFLAGS} == "-O2 -O1" ]] && [[ ${LDFLAGS} == "" ]]
+[[ ${CFLAGS} == "-O2 -B /foo -O1" ]] && [[ ${CXXFLAGS} == "-O2 -B /foo -O1" ]] && [[ ${LDFLAGS} == "-O2 -B /foo -O1" ]]
ftend
for var in $(all-flag-vars) ; do
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2019-11-20 20:30 Sergei Trofimovich
0 siblings, 0 replies; 94+ messages in thread
From: Sergei Trofimovich @ 2019-11-20 20:30 UTC (permalink / raw
To: gentoo-commits
commit: 7b7b4fe856baecfbe4b36831a88dac298e6bb2b9
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 20 20:28:40 2019 +0000
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Wed Nov 20 20:30:19 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7b7b4fe8
eclass/tests/toolchain-funcs.sh: fix tc-cpp-is-true tests
The test was failing on systems without clang because presence
of compiler was tested incorrectly (${compielr} typo).
Reported-by: Michał Górny
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
eclass/tests/toolchain-funcs.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/eclass/tests/toolchain-funcs.sh b/eclass/tests/toolchain-funcs.sh
index 79ba6fa407b..4cd4213c2de 100755
--- a/eclass/tests/toolchain-funcs.sh
+++ b/eclass/tests/toolchain-funcs.sh
@@ -172,8 +172,8 @@ if type -P pathcc &>/dev/null; then
tend $?
fi
-for compiler in gcc clang; do
- if type -P ${compielr} &>/dev/null; then
+for compiler in gcc clang not-really-a-compiler; do
+ if type -P ${compiler} &>/dev/null; then
tbegin "tc-cpp-is-true ($compiler, defined)"
(
export CC=${compiler}
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2019-11-24 15:09 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2019-11-24 15:09 UTC (permalink / raw
To: gentoo-commits
commit: c32cd67056099a178b5928ea6b2d0958b8ef45c8
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 24 14:39:47 2019 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Nov 24 15:09:14 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c32cd670
eclass/tests/python-utils-r1.sh: Add tests for _python_impl_matches
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/python-utils-r1.sh | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh
index e7c533d5f33..e883da38cea 100755
--- a/eclass/tests/python-utils-r1.sh
+++ b/eclass/tests/python-utils-r1.sh
@@ -192,6 +192,40 @@ test_is "_python_impl_supported pypy" 0
test_is "_python_impl_supported pypy3" 0
test_is "_python_impl_supported jython2_7" 0
+# check _python_impl_matches behavior
+test_is "_python_impl_matches python2_7 -2" 0
+test_is "_python_impl_matches python3_6 -2" 1
+test_is "_python_impl_matches python3_7 -2" 1
+test_is "_python_impl_matches pypy -2" 0
+test_is "_python_impl_matches pypy3 -2" 1
+test_is "_python_impl_matches python2_7 -3" 1
+test_is "_python_impl_matches python3_6 -3" 0
+test_is "_python_impl_matches python3_7 -3" 0
+test_is "_python_impl_matches pypy -3" 1
+test_is "_python_impl_matches pypy3 -3" 0
+test_is "_python_impl_matches python2_7 -2 python3_6" 0
+test_is "_python_impl_matches python3_6 -2 python3_6" 0
+test_is "_python_impl_matches python3_7 -2 python3_6" 1
+test_is "_python_impl_matches pypy -2 python3_6" 0
+test_is "_python_impl_matches pypy3 -2 python3_6" 1
+test_is "_python_impl_matches python2_7 pypy3 -2 python3_6" 0
+test_is "_python_impl_matches python3_6 pypy3 -2 python3_6" 0
+test_is "_python_impl_matches python3_7 pypy3 -2 python3_6" 1
+test_is "_python_impl_matches pypy pypy3 -2 python3_6" 0
+test_is "_python_impl_matches pypy3 pypy3 -2 python3_6" 0
+set -f
+test_is "_python_impl_matches python2_7 pypy*" 1
+test_is "_python_impl_matches python3_6 pypy*" 1
+test_is "_python_impl_matches python3_7 pypy*" 1
+test_is "_python_impl_matches pypy pypy*" 0
+test_is "_python_impl_matches pypy3 pypy*" 0
+test_is "_python_impl_matches python2_7 python*" 0
+test_is "_python_impl_matches python3_6 python*" 0
+test_is "_python_impl_matches python3_7 python*" 0
+test_is "_python_impl_matches pypy python*" 1
+test_is "_python_impl_matches pypy3 python*" 1
+set +f
+
rm "${tmpfile}"
texit
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2019-12-01 11:29 Sergei Trofimovich
0 siblings, 0 replies; 94+ messages in thread
From: Sergei Trofimovich @ 2019-12-01 11:29 UTC (permalink / raw
To: gentoo-commits
commit: ddcb3bf30c3dbdd42f1306ea4f0e8611b25ca81c
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 1 11:29:02 2019 +0000
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sun Dec 1 11:29:37 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ddcb3bf3
eclass/tests/toolchain.sh: fix 's/asserv/assert' typo
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
eclass/tests/toolchain.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/eclass/tests/toolchain.sh b/eclass/tests/toolchain.sh
index 2c09f2238d7..56609aa180e 100755
--- a/eclass/tests/toolchain.sh
+++ b/eclass/tests/toolchain.sh
@@ -150,7 +150,7 @@ test_var_assert() {
var_name=${1}
exp=${2}
- tbegin "asserv variable value: ${var_name} => ${exp}"
+ tbegin "assert variable value: ${var_name} => ${exp}"
if [[ ${!var_name} != ${exp} ]]; then
msg="Failure - Expected: \"${exp}\" Got: \"${!var_name}\""
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2019-12-07 16:59 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2019-12-07 16:59 UTC (permalink / raw
To: gentoo-commits
commit: cfdfd8c30a9aec68b34a958cc7e28cf823489f64
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 7 16:58:09 2019 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Dec 7 16:58:54 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cfdfd8c3
eclass/tests/distutils-r1.sh: Disable setuptools dep
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/distutils-r1.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/eclass/tests/distutils-r1.sh b/eclass/tests/distutils-r1.sh
index d5f3e2812ca..d251f85a5eb 100755
--- a/eclass/tests/distutils-r1.sh
+++ b/eclass/tests/distutils-r1.sh
@@ -47,6 +47,7 @@ test-distutils_enable_tests() {
tend ${ret}
}
+DISTUTILS_USE_SETUPTOOLS=no
inherit distutils-r1
tbegin "sane function names"
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2019-12-13 22:37 Sergei Trofimovich
0 siblings, 0 replies; 94+ messages in thread
From: Sergei Trofimovich @ 2019-12-13 22:37 UTC (permalink / raw
To: gentoo-commits
commit: 063d79790a2c0ee4542552f76334f511aaced319
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 13 22:22:11 2019 +0000
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Fri Dec 13 22:37:12 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=063d7979
eclass/tests/toolchain-funcs.sh: fix gold tests, bug #700812
As written tests assumed that $CC always called ld.bfd as a linker.
The assumption fails when default linker is not ld.bfd,
(for example sys-devel/binutils[default-gold]).
The change uses LDFLAGS=-fuse-ld=bfd explicitly.
Fixes the following tests:
* Testing tc-ld-is-gold (bfd selected) ... [ !! ]
* Testing tc-ld-disable-gold (bfd selected) ... [ !! ]
Reported-by: Michał Górny
Closes: https://bugs.gentoo.org/700812
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
eclass/tests/toolchain-funcs.sh | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/eclass/tests/toolchain-funcs.sh b/eclass/tests/toolchain-funcs.sh
index 4cd4213c2de..1cf124520c3 100755
--- a/eclass/tests/toolchain-funcs.sh
+++ b/eclass/tests/toolchain-funcs.sh
@@ -54,21 +54,21 @@ tend ${ret}
#
# TEST: tc-ld-is-gold
#
-tbegin "tc-ld-is-gold (bfd selected)"
-LD=ld.bfd tc-ld-is-gold && ret=1 || ret=0
+tbegin "tc-ld-is-gold (ld=bfd cc=bfd)"
+LD=ld.bfd LDFLAGS=-fuse-ld=bfd tc-ld-is-gold && ret=1 || ret=0
tend ${ret}
-tbegin "tc-ld-is-gold (gold selected)"
+tbegin "tc-ld-is-gold (ld=gold cc=default)"
LD=ld.gold tc-ld-is-gold
ret=$?
tend ${ret}
-tbegin "tc-ld-is-gold (bfd selected via flags)"
+tbegin "tc-ld-is-gold (ld=gold cc=bfd)"
LD=ld.gold LDFLAGS=-fuse-ld=bfd tc-ld-is-gold
ret=$?
tend ${ret}
-tbegin "tc-ld-is-gold (gold selected via flags)"
+tbegin "tc-ld-is-gold (ld=bfd cc=gold)"
LD=ld.bfd LDFLAGS=-fuse-ld=gold tc-ld-is-gold
ret=$?
tend ${ret}
@@ -78,14 +78,14 @@ tend ${ret}
#
tbegin "tc-ld-disable-gold (bfd selected)"
(
-export LD=ld.bfd LDFLAGS=
+export LD=ld.bfd LDFLAGS=-fuse-ld=bfd
ewarn() { :; }
tc-ld-disable-gold
-[[ ${LD} == "ld.bfd" && -z ${LDFLAGS} ]]
+[[ ${LD} == "ld.bfd" && ${LDFLAGS} == "-fuse-ld=bfd" ]]
)
tend $?
-tbegin "tc-ld-disable-gold (gold selected)"
+tbegin "tc-ld-disable-gold (ld=gold)"
(
export LD=ld.gold LDFLAGS=
ewarn() { :; }
@@ -94,7 +94,7 @@ tc-ld-disable-gold
)
tend $?
-tbegin "tc-ld-disable-gold (gold selected via flags)"
+tbegin "tc-ld-disable-gold (cc=gold)"
(
export LD= LDFLAGS="-fuse-ld=gold"
ewarn() { :; }
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2019-12-23 11:47 Sergei Trofimovich
0 siblings, 0 replies; 94+ messages in thread
From: Sergei Trofimovich @ 2019-12-23 11:47 UTC (permalink / raw
To: gentoo-commits
commit: 36613f4c0fb5eae1f99165156b85c348d38ecf24
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 23 11:32:39 2019 +0000
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Mon Dec 23 11:47:02 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=36613f4c
eclass/tests/flag-o-matic.sh: clarify the filter
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
eclass/tests/flag-o-matic.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/eclass/tests/flag-o-matic.sh b/eclass/tests/flag-o-matic.sh
index b0b97ea0bc1..7c078499d70 100755
--- a/eclass/tests/flag-o-matic.sh
+++ b/eclass/tests/flag-o-matic.sh
@@ -53,7 +53,7 @@ done <<<"
1 -n
"
-tbegin "strip-unsupported-flags"
+tbegin "strip-unsupported-flags for -z=2"
strip-unsupported-flags
[[ ${CFLAGS} == "--param l1-cache-size=32" ]] && [[ ${CXXFLAGS} == "-z=2" ]] && [[ ${LDFLAGS} == "" ]]
ftend
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2020-02-09 18:09 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2020-02-09 18:09 UTC (permalink / raw
To: gentoo-commits
commit: d3c570fb9e6fc1b4e5ec131c73843f0ebe8dbd12
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 9 18:09:36 2020 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Feb 9 18:09:36 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d3c570fb
eclass/tests/distutils-r1.sh: Update post eclass changes
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/distutils-r1.sh | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/eclass/tests/distutils-r1.sh b/eclass/tests/distutils-r1.sh
index d251f85a5eb..9ef4562edf1 100755
--- a/eclass/tests/distutils-r1.sh
+++ b/eclass/tests/distutils-r1.sh
@@ -70,9 +70,9 @@ einfo "empty RDEPEND"
eindent
RDEPEND=""
test-distutils_enable_tests pytest \
- "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( dev-python/pytest[${PYTHON_USEDEP}] )"
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( dev-python/pytest[${PYTHON_USEDEP}] )"
test-distutils_enable_tests nose \
- "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( dev-python/nose[${PYTHON_USEDEP}] )"
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( dev-python/nose[${PYTHON_USEDEP}] )"
test-distutils_enable_tests unittest \
"${BASE_IUSE}" "" "${BASE_DEPS}"
test-distutils_enable_tests setup.py \
@@ -84,13 +84,13 @@ eindent
BASE_RDEPEND="dev-python/foo[${PYTHON_USEDEP}]"
RDEPEND=${BASE_RDEPEND}
test-distutils_enable_tests pytest \
- "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( dev-python/pytest[${PYTHON_USEDEP}] ${BASE_RDEPEND} )"
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} dev-python/pytest[${PYTHON_USEDEP}] )"
test-distutils_enable_tests nose \
- "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( dev-python/nose[${PYTHON_USEDEP}] ${BASE_RDEPEND} )"
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} dev-python/nose[${PYTHON_USEDEP}] )"
test-distutils_enable_tests unittest \
- "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} )"
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} )"
test-distutils_enable_tests setup.py \
- "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} )"
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} )"
eoutdent
eoutdent
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2020-02-27 16:29 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2020-02-27 16:29 UTC (permalink / raw
To: gentoo-commits
commit: cd46eb3f8d5cc1bdbcf3277efa32d918285fc27e
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 27 16:29:12 2020 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Feb 27 16:29:12 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cd46eb3f
eclass/tests/python-utils-r1.sh: Cover PYTHON_{CFLAGS,LIBS}
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/python-utils-r1.sh | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh
index 279324e163b..4367890a08a 100755
--- a/eclass/tests/python-utils-r1.sh
+++ b/eclass/tests/python-utils-r1.sh
@@ -67,6 +67,8 @@ if [[ -x /usr/bin/python2.7 ]]; then
test_var PYTHON_INCLUDEDIR python2_7 /usr/include/python2.7
test_var PYTHON_LIBPATH python2_7 "/usr/lib*/libpython2.7$(get_libname)"
test_var PYTHON_CONFIG python2_7 /usr/bin/python2.7-config
+ test_var PYTHON_CFLAGS python2_7 "*-I/usr/include/python2.7*"
+ test_var PYTHON_LIBS python2_7 "*-lpython2.7*"
fi
test_var PYTHON_PKG_DEP python2_7 '*dev-lang/python*:2.7'
test_var PYTHON_SCRIPTDIR python2_7 /usr/lib/python-exec/python2.7
@@ -79,6 +81,8 @@ if [[ -x /usr/bin/python3.6 ]]; then
test_var PYTHON_INCLUDEDIR python3_6 "/usr/include/python3.6${abiflags}"
test_var PYTHON_LIBPATH python3_6 "/usr/lib*/libpython3.6${abiflags}$(get_libname)"
test_var PYTHON_CONFIG python3_6 "/usr/bin/python3.6${abiflags}-config"
+ test_var PYTHON_CFLAGS python3_6 "*-I/usr/include/python3.6*"
+ test_var PYTHON_LIBS python3_6 "*-lpython3.6*"
fi
test_var PYTHON_PKG_DEP python3_6 '*dev-lang/python*:3.6'
test_var PYTHON_SCRIPTDIR python3_6 /usr/lib/python-exec/python3.6
@@ -91,6 +95,8 @@ if [[ -x /usr/bin/python3.7 ]]; then
test_var PYTHON_INCLUDEDIR python3_7 "/usr/include/python3.7${abiflags}"
test_var PYTHON_LIBPATH python3_7 "/usr/lib*/libpython3.7${abiflags}$(get_libname)"
test_var PYTHON_CONFIG python3_7 "/usr/bin/python3.7${abiflags}-config"
+ test_var PYTHON_CFLAGS python3_7 "*-I/usr/include/python3.7*"
+ test_var PYTHON_LIBS python3_7 "*-lpython3.7*"
fi
test_var PYTHON_PKG_DEP python3_7 '*dev-lang/python*:3.7'
test_var PYTHON_SCRIPTDIR python3_7 /usr/lib/python-exec/python3.7
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2020-03-27 23:54 Sergei Trofimovich
0 siblings, 0 replies; 94+ messages in thread
From: Sergei Trofimovich @ 2020-03-27 23:54 UTC (permalink / raw
To: gentoo-commits
commit: ba0d4bc94f655ff82d69276d79f9d85e8e8e01eb
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 27 23:42:03 2020 +0000
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Fri Mar 27 23:54:40 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ba0d4bc9
eclass/tests: add basic tests for multilib_env() expansion
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
eclass/tests/multilib.sh | 61 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 61 insertions(+)
diff --git a/eclass/tests/multilib.sh b/eclass/tests/multilib.sh
new file mode 100755
index 00000000000..308c456b98d
--- /dev/null
+++ b/eclass/tests/multilib.sh
@@ -0,0 +1,61 @@
+#!/bin/bash
+# Copyright 1999-2020 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+source tests-common.sh
+
+inherit multilib
+
+# Run 'multilib_env' and check what variables it expands to
+test-multilib_env() {
+ local target=$1 exp_abi=$2 exp_vars=" $3"
+ tbegin "expand-target $1"
+
+ # Reset default
+ unset MULTILIB_ABIS
+ unset DEFAULT_ABI
+ CFLAGS_default=
+ LDFLAGS_default=
+ LIBDIR_default=lib
+ CHOST_default=${target}
+ CTARGET_default=${CHOST_default}
+ LIBDIR_default=lib
+
+ multilib_env ${target}
+
+ local actual_abi="${DEFAULT_ABI}:${MULTILIB_ABIS}"
+
+ local actual_vars=""
+ local abi var v
+ for abi in ${MULTILIB_ABIS}; do
+ actual_vars+=" ${abi}? ("
+ for var in CHOST LIBDIR CFLAGS LDFLAGS; do
+ v=${var}_${abi}
+ actual_vars+=" ${var}=${!v}"
+ done
+ actual_vars+=" )"
+ done
+
+ [[ "${exp_abi}" == "${actual_abi}" && "${exp_vars}" == "${actual_vars}" ]]
+
+ if ! tend $? ; then
+ printf '### EXPECTED ABI: %s\n' "${exp_abi}"
+ printf '### ACTUAL ABI: %s\n' "${actual_abi}"
+ printf '### EXPECTED VARS: %s\n' "${exp_vars}"
+ printf '### ACTUAL VARS: %s\n' "${actual_vars}"
+ fi
+}
+
+# Pick a few interesting gargets from:
+# $ grep -h -o -R 'CHOST=.*' ../../profiles/ | sort -u
+
+test-multilib_env \
+ "x86_64-pc-linux-gnu" \
+ "amd64:amd64 x86" \
+ "amd64? ( CHOST=x86_64-pc-linux-gnu LIBDIR=lib64 CFLAGS=-m64 LDFLAGS= ) x86? ( CHOST=i686-pc-linux-gnu LIBDIR=lib CFLAGS=-m32 LDFLAGS= )"
+test-multilib_env \
+ "x86_64-pc-linux-gnux32" \
+ "x32:x32 amd64 x86" \
+ "x32? ( CHOST=x86_64-pc-linux-gnux32 LIBDIR=libx32 CFLAGS=-mx32 LDFLAGS= ) amd64? ( CHOST=x86_64-pc-linux-gnu LIBDIR=lib64 CFLAGS=-m64 LDFLAGS= ) x86? ( CHOST=i686-pc-linux-gnu LIBDIR=lib CFLAGS=-m32 LDFLAGS= )"
+
+texit
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2020-03-30 11:57 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2020-03-30 11:57 UTC (permalink / raw
To: gentoo-commits
commit: 9e1d480c2fdd9906aaa4bfe6e20be8ceb0c9af7c
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 30 11:56:34 2020 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Mar 30 11:57:33 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9e1d480c
eclass/tests/distutils-r1.sh: Update Python versions
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/distutils-r1.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/eclass/tests/distutils-r1.sh b/eclass/tests/distutils-r1.sh
index 9ef4562edf1..10f57b59edf 100755
--- a/eclass/tests/distutils-r1.sh
+++ b/eclass/tests/distutils-r1.sh
@@ -63,7 +63,7 @@ tend
einfo distutils_enable_tests
eindent
BASE_IUSE="python_targets_python2_7"
-BASE_DEPS="python_targets_python2_7? ( >=dev-lang/python-2.7.5-r2:2.7 ) >=dev-lang/python-exec-2:=[python_targets_python2_7(-)?,-python_single_target_python2_7(-)]"
+BASE_DEPS="python_targets_python2_7? ( >=dev-lang/python-2.7.17-r1:2.7 ) >=dev-lang/python-exec-2:=[python_targets_python2_7(-)?,-python_single_target_python2_7(-)]"
TEST_RESTRICT=" !test? ( test )"
einfo "empty RDEPEND"
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2020-03-30 13:11 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2020-03-30 13:11 UTC (permalink / raw
To: gentoo-commits
commit: 38b8184d18a7c43559f6578e9974703350cc3ed1
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 30 13:10:11 2020 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Mar 30 13:11:06 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=38b8184d
eclass/tests/python-utils-r1.sh: Remove tests for jython & pypy
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/python-utils-r1.sh | 31 -------------------------------
1 file changed, 31 deletions(-)
diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh
index 2ce425be15e..377bb474a3a 100755
--- a/eclass/tests/python-utils-r1.sh
+++ b/eclass/tests/python-utils-r1.sh
@@ -101,23 +101,6 @@ fi
test_var PYTHON_PKG_DEP python3_7 '*dev-lang/python*:3.7'
test_var PYTHON_SCRIPTDIR python3_7 /usr/lib/python-exec/python3.7
-test_var EPYTHON jython2_7 jython2.7
-test_var PYTHON jython2_7 /usr/bin/jython2.7
-if [[ -x /usr/bin/jython2.7 ]]; then
- test_var PYTHON_SITEDIR jython2_7 /usr/share/jython-2.7/Lib/site-packages
-fi
-test_var PYTHON_PKG_DEP jython2_7 '*dev-java/jython*:2.7'
-test_var PYTHON_SCRIPTDIR jython2_7 /usr/lib/python-exec/jython2.7
-
-test_var EPYTHON pypy pypy
-test_var PYTHON pypy /usr/bin/pypy
-if [[ -x /usr/bin/pypy ]]; then
- test_var PYTHON_SITEDIR pypy "/usr/lib*/pypy2.7/site-packages"
- test_var PYTHON_INCLUDEDIR pypy "/usr/lib*/pypy2.7/include"
-fi
-test_var PYTHON_PKG_DEP pypy '*dev-python/pypy*:0='
-test_var PYTHON_SCRIPTDIR pypy /usr/lib/python-exec/pypy
-
test_var EPYTHON pypy3 pypy3
test_var PYTHON pypy3 /usr/bin/pypy3
if [[ -x /usr/bin/pypy3 ]]; then
@@ -129,16 +112,13 @@ test_var PYTHON_SCRIPTDIR pypy3 /usr/lib/python-exec/pypy3
test_is "python_is_python3 python2.7" 1
test_is "python_is_python3 python3.2" 0
-test_is "python_is_python3 jython2.7" 1
test_is "python_is_python3 pypy" 1
test_is "python_is_python3 pypy3" 0
# generic shebangs
test_fix_shebang '#!/usr/bin/python' python2.7 '#!/usr/bin/python2.7'
test_fix_shebang '#!/usr/bin/python' python3.6 '#!/usr/bin/python3.6'
-test_fix_shebang '#!/usr/bin/python' pypy '#!/usr/bin/pypy'
test_fix_shebang '#!/usr/bin/python' pypy3 '#!/usr/bin/pypy3'
-test_fix_shebang '#!/usr/bin/python' jython2.7 '#!/usr/bin/jython2.7'
# python2/python3 matching
test_fix_shebang '#!/usr/bin/python2' python2.7 '#!/usr/bin/python2.7'
@@ -155,12 +135,8 @@ test_fix_shebang '#!/usr/bin/python2.7' python3.2 '#!/usr/bin/python3.2' --force
test_fix_shebang '#!/usr/bin/python3.2' python3.2 '#!/usr/bin/python3.2'
test_fix_shebang '#!/usr/bin/python3.2' python2.7 FAIL
test_fix_shebang '#!/usr/bin/python3.2' python2.7 '#!/usr/bin/python2.7' --force
-test_fix_shebang '#!/usr/bin/pypy' pypy '#!/usr/bin/pypy'
test_fix_shebang '#!/usr/bin/pypy' python2.7 FAIL
test_fix_shebang '#!/usr/bin/pypy' python2.7 '#!/usr/bin/python2.7' --force
-test_fix_shebang '#!/usr/bin/jython2.7' jython2.7 '#!/usr/bin/jython2.7'
-test_fix_shebang '#!/usr/bin/jython2.7' jython3.2 FAIL
-test_fix_shebang '#!/usr/bin/jython2.7' jython3.2 '#!/usr/bin/jython3.2' --force
# fancy path handling
test_fix_shebang '#!/mnt/python2/usr/bin/python' python3.6 \
@@ -196,39 +172,32 @@ test_is "_python_impl_supported pypy1_9" 1
test_is "_python_impl_supported pypy2_0" 1
test_is "_python_impl_supported pypy" 1
test_is "_python_impl_supported pypy3" 0
-test_is "_python_impl_supported jython2_7" 1
# check _python_impl_matches behavior
test_is "_python_impl_matches python2_7 -2" 0
test_is "_python_impl_matches python3_6 -2" 1
test_is "_python_impl_matches python3_7 -2" 1
-test_is "_python_impl_matches pypy -2" 0
test_is "_python_impl_matches pypy3 -2" 1
test_is "_python_impl_matches python2_7 -3" 1
test_is "_python_impl_matches python3_6 -3" 0
test_is "_python_impl_matches python3_7 -3" 0
-test_is "_python_impl_matches pypy -3" 1
test_is "_python_impl_matches pypy3 -3" 0
test_is "_python_impl_matches python2_7 -2 python3_6" 0
test_is "_python_impl_matches python3_6 -2 python3_6" 0
test_is "_python_impl_matches python3_7 -2 python3_6" 1
-test_is "_python_impl_matches pypy -2 python3_6" 0
test_is "_python_impl_matches pypy3 -2 python3_6" 1
test_is "_python_impl_matches python2_7 pypy3 -2 python3_6" 0
test_is "_python_impl_matches python3_6 pypy3 -2 python3_6" 0
test_is "_python_impl_matches python3_7 pypy3 -2 python3_6" 1
-test_is "_python_impl_matches pypy pypy3 -2 python3_6" 0
test_is "_python_impl_matches pypy3 pypy3 -2 python3_6" 0
set -f
test_is "_python_impl_matches python2_7 pypy*" 1
test_is "_python_impl_matches python3_6 pypy*" 1
test_is "_python_impl_matches python3_7 pypy*" 1
-test_is "_python_impl_matches pypy pypy*" 0
test_is "_python_impl_matches pypy3 pypy*" 0
test_is "_python_impl_matches python2_7 python*" 0
test_is "_python_impl_matches python3_6 python*" 0
test_is "_python_impl_matches python3_7 python*" 0
-test_is "_python_impl_matches pypy python*" 1
test_is "_python_impl_matches pypy3 python*" 1
set +f
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2020-04-19 16:47 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2020-04-19 16:47 UTC (permalink / raw
To: gentoo-commits
commit: 73c127b0891aae921d60478fe377bf6c4ee50f13
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 27 18:00:10 2020 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Apr 19 16:47:08 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=73c127b0
eclass/tests/python-utils-r1.sh: Add tests for py3.8
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/python-utils-r1.sh | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh
index 377bb474a3a..192c1183e80 100755
--- a/eclass/tests/python-utils-r1.sh
+++ b/eclass/tests/python-utils-r1.sh
@@ -101,6 +101,20 @@ fi
test_var PYTHON_PKG_DEP python3_7 '*dev-lang/python*:3.7'
test_var PYTHON_SCRIPTDIR python3_7 /usr/lib/python-exec/python3.7
+test_var EPYTHON python3_8 python3.8
+test_var PYTHON python3_8 /usr/bin/python3.8
+if [[ -x /usr/bin/python3.8 ]]; then
+ abiflags=$(/usr/bin/python3.8 -c 'import sysconfig; print(sysconfig.get_config_var("ABIFLAGS"))')
+ test_var PYTHON_SITEDIR python3_8 "/usr/lib/python3.8/site-packages"
+ test_var PYTHON_INCLUDEDIR python3_8 "/usr/include/python3.8${abiflags}"
+ test_var PYTHON_LIBPATH python3_8 "/usr/lib*/libpython3.8${abiflags}$(get_libname)"
+ test_var PYTHON_CONFIG python3_8 "/usr/bin/python3.8${abiflags}-config"
+ test_var PYTHON_CFLAGS python3_8 "*-I/usr/include/python3.8*"
+ test_var PYTHON_LIBS python3_8 "*-lpython3.8*"
+fi
+test_var PYTHON_PKG_DEP python3_8 '*dev-lang/python*:3.8'
+test_var PYTHON_SCRIPTDIR python3_8 /usr/lib/python-exec/python3.8
+
test_var EPYTHON pypy3 pypy3
test_var PYTHON pypy3 /usr/bin/pypy3
if [[ -x /usr/bin/pypy3 ]]; then
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2020-04-30 9:45 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2020-04-30 9:45 UTC (permalink / raw
To: gentoo-commits
commit: a80411e43523cf60fb40120045a66d331eba7f2d
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 30 09:40:00 2020 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Apr 30 09:45:22 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a80411e4
eclass/tests/distutils-r1.sh: Revert "Update Python versions"
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/distutils-r1.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/eclass/tests/distutils-r1.sh b/eclass/tests/distutils-r1.sh
index 10f57b59edf..9ef4562edf1 100755
--- a/eclass/tests/distutils-r1.sh
+++ b/eclass/tests/distutils-r1.sh
@@ -63,7 +63,7 @@ tend
einfo distutils_enable_tests
eindent
BASE_IUSE="python_targets_python2_7"
-BASE_DEPS="python_targets_python2_7? ( >=dev-lang/python-2.7.17-r1:2.7 ) >=dev-lang/python-exec-2:=[python_targets_python2_7(-)?,-python_single_target_python2_7(-)]"
+BASE_DEPS="python_targets_python2_7? ( >=dev-lang/python-2.7.5-r2:2.7 ) >=dev-lang/python-exec-2:=[python_targets_python2_7(-)?,-python_single_target_python2_7(-)]"
TEST_RESTRICT=" !test? ( test )"
einfo "empty RDEPEND"
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2020-05-10 1:02 Sergei Trofimovich
0 siblings, 0 replies; 94+ messages in thread
From: Sergei Trofimovich @ 2020-05-10 1:02 UTC (permalink / raw
To: gentoo-commits
commit: e0f8418663dff3c4e51899b8ccb172363478591a
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sun May 10 01:02:07 2020 +0000
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sun May 10 01:02:07 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e0f84186
eclass/tests/toolchain.sh: add znver2 downgrade test
Bug: https://bugs.gentoo.org/721690
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
eclass/tests/toolchain.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/eclass/tests/toolchain.sh b/eclass/tests/toolchain.sh
index 1d05f6c126b..e69e0c8f1dd 100755
--- a/eclass/tests/toolchain.sh
+++ b/eclass/tests/toolchain.sh
@@ -83,6 +83,7 @@ test_downgrade_arch_flags 3.3 "-march=k6-2" "-march=geode -mtune=barcelona
test_downgrade_arch_flags 3.4 "-march=k8" "-march=btver2 -mtune=generic"
test_downgrade_arch_flags 10 "-march=native" "-march=native"
+test_downgrade_arch_flags 8 "-march=znver1" "-march=znver2"
test_downgrade_arch_flags 4.2 "-march=native" "-march=native"
test_downgrade_arch_flags 4.1 "-march=nocona" "-march=native"
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2020-05-28 11:41 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2020-05-28 11:41 UTC (permalink / raw
To: gentoo-commits
commit: dba4f2113f6cfa539246acdad25459a479d7f434
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue May 26 07:25:56 2020 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu May 28 11:41:20 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dba4f211
llvm.eclass: Add initial tests
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/llvm.sh | 138 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 138 insertions(+)
diff --git a/eclass/tests/llvm.sh b/eclass/tests/llvm.sh
new file mode 100755
index 00000000000..bb8d5fc998e
--- /dev/null
+++ b/eclass/tests/llvm.sh
@@ -0,0 +1,138 @@
+#!/bin/bash
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+source tests-common.sh
+
+inherit llvm
+
+# llvm_check_deps override to disable has_version use.
+# in: ${LLVM_SLOT}
+# returns 0 if installed (i.e. == LLVM_INSTALLED_SLOT), 1 otherwise
+llvm_check_deps() {
+ [[ ${LLVM_SLOT} == ${LLVM_INSTALLED_SLOT} ]]
+}
+
+# check_prefix <expected> [<args>...]
+# Check output of `get_llvm_prefix <args>...`.
+check_prefix() {
+ local expected=${1}
+ shift
+
+ tbegin "get_llvm_prefix ${*}; inst=${LLVM_INSTALLED_SLOT} -> ${expected}"
+ prefix=$(get_llvm_prefix "${@}")
+ [[ ${prefix} == ${expected} ]] ||
+ eerror "got: ${prefix} != exp: ${expected}"
+ tend ${?}
+}
+
+# check_setup_path <expected>
+# Check PATH after pkg_setup.
+check_setup_path() {
+ local expected=${1}
+ shift
+
+ tbegin "pkg_setup; max=${LLVM_MAX_SLOT}; inst=${LLVM_INSTALLED_SLOT} -> PATH=${expected}"
+ path=$(llvm_pkg_setup; echo "${PATH}")
+ [[ ${path} == ${expected} ]] ||
+ eerror "got: ${path} != exp: ${expected}"
+ tend ${?}
+}
+
+
+EAPI=7
+BROOT=/broot
+SYSROOT=/sysroot
+ESYSROOT=/sysroot/eprefix
+ROOT=/root
+EROOT=/root/eprefix
+
+ebegin "Testing check_setup_path without max slot"
+eindent
+ LLVM_INSTALLED_SLOT=11 \
+ check_prefix /sysroot/eprefix/usr/lib/llvm/11
+ LLVM_INSTALLED_SLOT=10 \
+ check_prefix /sysroot/eprefix/usr/lib/llvm/10
+eoutdent
+
+ebegin "Testing check_setup_path with max slot"
+eindent
+ LLVM_INSTALLED_SLOT=1* \
+ check_prefix /sysroot/eprefix/usr/lib/llvm/11 11
+ LLVM_INSTALLED_SLOT=1* \
+ check_prefix /sysroot/eprefix/usr/lib/llvm/10 10
+ LLVM_INSTALLED_SLOT=10 \
+ check_prefix /sysroot/eprefix/usr/lib/llvm/10 11
+eoutdent
+
+ebegin "Testing check_setup_path option switches"
+eindent
+ LLVM_INSTALLED_SLOT=11 \
+ check_prefix /broot/usr/lib/llvm/11 -b
+ LLVM_INSTALLED_SLOT=11 \
+ check_prefix /sysroot/eprefix/usr/lib/llvm/11 -d
+eoutdent
+
+ebegin "Testing check_setup_path EAPI 6 API"
+eindent
+ EAPI=6 \
+ LLVM_INSTALLED_SLOT=11 \
+ check_prefix /usr/lib/llvm/11 -d
+eoutdent
+
+BASEPATH=/usr/lib/ccache/bin:/usr/bin:/usr/sbin:/bin:/sbin
+
+# TODO: cross support?
+ESYSROOT=
+
+ebegin "Testing pkg_setup with all installed LLVM versions in PATH"
+eindent
+ LLVM_MAX_SLOT=11 \
+ LLVM_INSTALLED_SLOT=1* \
+ PATH=${BASEPATH}:/usr/lib/llvm/11/bin \
+ check_setup_path "/usr/lib/llvm/11/bin:${BASEPATH}:/usr/lib/llvm/11/bin"
+
+ LLVM_MAX_SLOT=10 \
+ LLVM_INSTALLED_SLOT=1* \
+ PATH=${BASEPATH}:/usr/lib/llvm/11/bin:/usr/lib/llvm/10/bin \
+ check_setup_path "/usr/lib/llvm/10/bin:${BASEPATH}:/usr/lib/llvm/11/bin:/usr/lib/llvm/10/bin"
+
+ LLVM_MAX_SLOT=11 \
+ LLVM_INSTALLED_SLOT=10 \
+ PATH=${BASEPATH}:/usr/lib/llvm/10/bin \
+ check_setup_path "/usr/lib/llvm/10/bin:${BASEPATH}:/usr/lib/llvm/10/bin"
+eoutdent
+
+ebegin "Testing pkg_setup with the other LLVM version in PATH"
+eindent
+ LLVM_MAX_SLOT=11 \
+ LLVM_INSTALLED_SLOT=1* \
+ PATH=${BASEPATH}:/usr/lib/llvm/10/bin \
+ check_setup_path "/usr/lib/llvm/11/bin:${BASEPATH}:/usr/lib/llvm/10/bin"
+
+ LLVM_MAX_SLOT=10 \
+ LLVM_INSTALLED_SLOT=1* \
+ PATH=${BASEPATH}:/usr/lib/llvm/11/bin \
+ check_setup_path "/usr/lib/llvm/10/bin:${BASEPATH}:/usr/lib/llvm/11/bin"
+eoutdent
+
+ebegin "Testing pkg_setup with LLVM missing from PATH"
+eindent
+ LLVM_MAX_SLOT=11 \
+ LLVM_INSTALLED_SLOT=1* \
+ PATH=${BASEPATH} \
+ check_setup_path "/usr/lib/llvm/11/bin:${BASEPATH}"
+
+ LLVM_MAX_SLOT=10 \
+ LLVM_INSTALLED_SLOT=1* \
+ PATH=${BASEPATH} \
+ check_setup_path "/usr/lib/llvm/10/bin:${BASEPATH}"
+
+ LLVM_MAX_SLOT=11 \
+ LLVM_INSTALLED_SLOT=10 \
+ PATH=${BASEPATH} \
+ check_setup_path "/usr/lib/llvm/10/bin:${BASEPATH}"
+eoutdent
+
+texit
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2020-06-19 11:52 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2020-06-19 11:52 UTC (permalink / raw
To: gentoo-commits
commit: ded0ce319d6cb29d2eb7568fec55c7db7a601371
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 19 11:52:06 2020 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jun 19 11:52:06 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ded0ce31
eclass/tests/distutils-r1.sh: update dep values
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/distutils-r1.sh | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/eclass/tests/distutils-r1.sh b/eclass/tests/distutils-r1.sh
index 9ef4562edf1..4c8e37b2617 100755
--- a/eclass/tests/distutils-r1.sh
+++ b/eclass/tests/distutils-r1.sh
@@ -70,9 +70,9 @@ einfo "empty RDEPEND"
eindent
RDEPEND=""
test-distutils_enable_tests pytest \
- "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( dev-python/pytest[${PYTHON_USEDEP}] )"
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( >=dev-python/pytest-4.5.0[${PYTHON_USEDEP}] )"
test-distutils_enable_tests nose \
- "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( dev-python/nose[${PYTHON_USEDEP}] )"
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( >=dev-python/nose-1.3.7-r4[${PYTHON_USEDEP}] )"
test-distutils_enable_tests unittest \
"${BASE_IUSE}" "" "${BASE_DEPS}"
test-distutils_enable_tests setup.py \
@@ -84,9 +84,9 @@ eindent
BASE_RDEPEND="dev-python/foo[${PYTHON_USEDEP}]"
RDEPEND=${BASE_RDEPEND}
test-distutils_enable_tests pytest \
- "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} dev-python/pytest[${PYTHON_USEDEP}] )"
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} >=dev-python/pytest-4.5.0[${PYTHON_USEDEP}] )"
test-distutils_enable_tests nose \
- "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} dev-python/nose[${PYTHON_USEDEP}] )"
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} >=dev-python/nose-1.3.7-r4[${PYTHON_USEDEP}] )"
test-distutils_enable_tests unittest \
"${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} )"
test-distutils_enable_tests setup.py \
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2020-07-02 8:29 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2020-07-02 8:29 UTC (permalink / raw
To: gentoo-commits
commit: 16c2e7ec5b7b6da9dd8f23d3fe86bbe8b32be3f8
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 2 06:29:07 2020 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Jul 2 08:29:14 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=16c2e7ec
eclass/tests/distutils-r1.sh: update for EAPI=7 / py3.8
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/distutils-r1.sh | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/eclass/tests/distutils-r1.sh b/eclass/tests/distutils-r1.sh
index 4c8e37b2617..b511e19d9e7 100755
--- a/eclass/tests/distutils-r1.sh
+++ b/eclass/tests/distutils-r1.sh
@@ -1,9 +1,9 @@
#!/bin/bash
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=5
-PYTHON_COMPAT=( python2_7 )
+EAPI=7
+PYTHON_COMPAT=( python3_8 )
source tests-common.sh
test-phase_name_free() {
@@ -21,18 +21,18 @@ test-distutils_enable_tests() {
local runner=${1}
local exp_IUSE=${2}
local exp_RESTRICT=${3}
- local exp_DEPEND=${4}
+ local exp_BDEPEND=${4}
local IUSE=${IUSE}
local RESTRICT=${RESTRICT}
- local DEPEND=${DEPEND}
+ local BDEPEND=${BDEPEND}
tbegin "${runner}"
distutils_enable_tests "${runner}"
local ret var
- for var in IUSE RESTRICT DEPEND; do
+ for var in IUSE RESTRICT BDEPEND; do
local exp_var=exp_${var}
if [[ ${!var} != "${!exp_var}" ]]; then
eindent
@@ -62,8 +62,8 @@ tend
einfo distutils_enable_tests
eindent
-BASE_IUSE="python_targets_python2_7"
-BASE_DEPS="python_targets_python2_7? ( >=dev-lang/python-2.7.5-r2:2.7 ) >=dev-lang/python-exec-2:=[python_targets_python2_7(-)?,-python_single_target_python2_7(-)]"
+BASE_IUSE="python_targets_python3_8"
+BASE_DEPS="python_targets_python3_8? ( dev-lang/python:3.8 ) >=dev-lang/python-exec-2:=[python_targets_python3_8(-)?,-python_single_target_python3_8(-)]"
TEST_RESTRICT=" !test? ( test )"
einfo "empty RDEPEND"
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2020-07-02 8:29 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2020-07-02 8:29 UTC (permalink / raw
To: gentoo-commits
commit: edbad14a5a79e4972092707475ee3cf00e3b07ca
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 2 07:28:04 2020 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Jul 2 08:29:16 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=edbad14a
eclass/tests/distutils-r1:single.sh: Tests for d-r1 single impl mode
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/distutils-r1_single.sh | 81 +++++++++++++++++++++++++++++++++++++
1 file changed, 81 insertions(+)
diff --git a/eclass/tests/distutils-r1_single.sh b/eclass/tests/distutils-r1_single.sh
new file mode 100755
index 00000000000..6c79e36881b
--- /dev/null
+++ b/eclass/tests/distutils-r1_single.sh
@@ -0,0 +1,81 @@
+#!/bin/bash
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+PYTHON_COMPAT=( python3_8 )
+source tests-common.sh
+
+test-distutils_enable_tests() {
+ local runner=${1}
+ local exp_IUSE=${2}
+ local exp_RESTRICT=${3}
+ local exp_BDEPEND=${4}
+
+ local IUSE=${IUSE}
+ local RESTRICT=${RESTRICT}
+ local BDEPEND=${BDEPEND}
+
+ tbegin "${runner}"
+
+ distutils_enable_tests "${runner}"
+
+ local ret var
+ for var in IUSE RESTRICT BDEPEND; do
+ local exp_var=exp_${var}
+ # (this normalizes whitespace)
+ read -d $'\0' -r -a val <<<"${!var}"
+ val=${val[*]}
+ if [[ ${val} != "${!exp_var}" ]]; then
+ eindent
+ eerror "${var} expected: ${!exp_var}"
+ eerror "${var} actual: ${val}"
+ eoutdent
+ ret=1
+ tret=1
+ fi
+ done
+
+ tend ${ret}
+}
+
+DISTUTILS_USE_SETUPTOOLS=no
+DISTUTILS_SINGLE_IMPL=1
+inherit distutils-r1
+
+einfo distutils_enable_tests
+eindent
+BASE_IUSE="+python_single_target_python3_8"
+BASE_DEPS="python_single_target_python3_8? ( dev-lang/python:3.8 >=dev-lang/python-exec-2:=[python_targets_python3_8] )"
+TEST_RESTRICT="!test? ( test )"
+
+einfo "empty RDEPEND"
+eindent
+RDEPEND=""
+test-distutils_enable_tests pytest \
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( python_single_target_python3_8? ( >=dev-python/pytest-4.5.0[python_targets_python3_8(-)] ) )"
+test-distutils_enable_tests nose \
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( python_single_target_python3_8? ( >=dev-python/nose-1.3.7-r4[python_targets_python3_8(-)] ) )"
+test-distutils_enable_tests unittest \
+ "${BASE_IUSE}" "" "${BASE_DEPS}"
+test-distutils_enable_tests setup.py \
+ "${BASE_IUSE}" "" "${BASE_DEPS}"
+eoutdent
+
+einfo "non-empty RDEPEND"
+eindent
+BASE_RDEPEND="dev-python/foo[${PYTHON_SINGLE_USEDEP}]"
+RDEPEND=${BASE_RDEPEND}
+test-distutils_enable_tests pytest \
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} python_single_target_python3_8? ( >=dev-python/pytest-4.5.0[python_targets_python3_8(-)] ) )"
+test-distutils_enable_tests nose \
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} python_single_target_python3_8? ( >=dev-python/nose-1.3.7-r4[python_targets_python3_8(-)] ) )"
+test-distutils_enable_tests unittest \
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} )"
+test-distutils_enable_tests setup.py \
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} )"
+eoutdent
+
+eoutdent
+
+texit
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2020-07-02 8:29 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2020-07-02 8:29 UTC (permalink / raw
To: gentoo-commits
commit: f60282d584bf9456f4a2ec2a1ebdf87f33b82ea2
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 2 07:08:33 2020 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Jul 2 08:29:15 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f60282d5
eclass/tests/distutils-r1.sh: Normalize whitespace
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/distutils-r1.sh | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/eclass/tests/distutils-r1.sh b/eclass/tests/distutils-r1.sh
index b511e19d9e7..237fc1eebae 100755
--- a/eclass/tests/distutils-r1.sh
+++ b/eclass/tests/distutils-r1.sh
@@ -31,13 +31,16 @@ test-distutils_enable_tests() {
distutils_enable_tests "${runner}"
- local ret var
+ local ret var val
for var in IUSE RESTRICT BDEPEND; do
local exp_var=exp_${var}
- if [[ ${!var} != "${!exp_var}" ]]; then
+ # (this normalizes whitespace)
+ read -a val <<<"${!var}"
+ val=${val[*]}
+ if [[ ${val} != "${!exp_var}" ]]; then
eindent
eerror "${var} expected: ${!exp_var}"
- eerror "${var} actual: ${!var}"
+ eerror "${var} actual: ${val}"
eoutdent
ret=1
tret=1
@@ -64,15 +67,15 @@ einfo distutils_enable_tests
eindent
BASE_IUSE="python_targets_python3_8"
BASE_DEPS="python_targets_python3_8? ( dev-lang/python:3.8 ) >=dev-lang/python-exec-2:=[python_targets_python3_8(-)?,-python_single_target_python3_8(-)]"
-TEST_RESTRICT=" !test? ( test )"
+TEST_RESTRICT="!test? ( test )"
einfo "empty RDEPEND"
eindent
RDEPEND=""
test-distutils_enable_tests pytest \
- "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( >=dev-python/pytest-4.5.0[${PYTHON_USEDEP}] )"
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( >=dev-python/pytest-4.5.0[${PYTHON_USEDEP}] )"
test-distutils_enable_tests nose \
- "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( >=dev-python/nose-1.3.7-r4[${PYTHON_USEDEP}] )"
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( >=dev-python/nose-1.3.7-r4[${PYTHON_USEDEP}] )"
test-distutils_enable_tests unittest \
"${BASE_IUSE}" "" "${BASE_DEPS}"
test-distutils_enable_tests setup.py \
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2020-07-02 8:29 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2020-07-02 8:29 UTC (permalink / raw
To: gentoo-commits
commit: 2917508e1ac399d73e4714468ee95a3a28cb979f
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 2 08:09:02 2020 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Jul 2 08:29:18 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2917508e
eclass/tests/distutils-r1*.sh: Cover DISTUTILS_USE_SETUPTOOLS
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/distutils-r1.sh | 43 ++++++++++++++++++++++++++++++++++++-
eclass/tests/distutils-r1_single.sh | 41 +++++++++++++++++++++++++++++++++++
2 files changed, 83 insertions(+), 1 deletion(-)
diff --git a/eclass/tests/distutils-r1.sh b/eclass/tests/distutils-r1.sh
index 237fc1eebae..93496f9ac00 100755
--- a/eclass/tests/distutils-r1.sh
+++ b/eclass/tests/distutils-r1.sh
@@ -35,7 +35,38 @@ test-distutils_enable_tests() {
for var in IUSE RESTRICT BDEPEND; do
local exp_var=exp_${var}
# (this normalizes whitespace)
- read -a val <<<"${!var}"
+ read -d $'\0' -r -a val <<<"${!var}"
+ val=${val[*]}
+ if [[ ${val} != "${!exp_var}" ]]; then
+ eindent
+ eerror "${var} expected: ${!exp_var}"
+ eerror "${var} actual: ${val}"
+ eoutdent
+ ret=1
+ tret=1
+ fi
+ done
+
+ tend ${ret}
+}
+
+test-DISTUTILS_USE_SETUPTOOLS() {
+ local DISTUTILS_USE_SETUPTOOLS=${1}
+ local exp_BDEPEND=${2}
+ local exp_RDEPEND=${3}
+
+ tbegin "${1}"
+
+ local BDEPEND=
+ local RDEPEND=
+ unset _DISTUTILS_R1
+ inherit distutils-r1
+
+ local ret var val
+ for var in BDEPEND RDEPEND; do
+ local exp_var=exp_${var}
+ # (this normalizes whitespace)
+ read -d $'\0' -r -a val <<<"${!var}"
val=${val[*]}
if [[ ${val} != "${!exp_var}" ]]; then
eindent
@@ -98,4 +129,14 @@ eoutdent
eoutdent
+einfo DISTUTILS_USE_SETUPTOOLS
+eindent
+SETUPTOOLS_DEP=">=dev-python/setuptools-42.0.2[python_targets_python3_8(-)?,-python_single_target_python3_8(-)]"
+test-DISTUTILS_USE_SETUPTOOLS no "${BASE_DEPS}" "${BASE_DEPS}"
+test-DISTUTILS_USE_SETUPTOOLS bdepend "${BASE_DEPS} ${SETUPTOOLS_DEP}" "${BASE_DEPS}"
+test-DISTUTILS_USE_SETUPTOOLS rdepend "${BASE_DEPS} ${SETUPTOOLS_DEP}" "${BASE_DEPS} ${SETUPTOOLS_DEP}"
+test-DISTUTILS_USE_SETUPTOOLS pyproject.toml "${BASE_DEPS} dev-python/pyproject2setuppy[python_targets_python3_8(-)?,-python_single_target_python3_8(-)]" "${BASE_DEPS}"
+test-DISTUTILS_USE_SETUPTOOLS manual "${BASE_DEPS}" "${BASE_DEPS}"
+eoutdent
+
texit
diff --git a/eclass/tests/distutils-r1_single.sh b/eclass/tests/distutils-r1_single.sh
index 6c79e36881b..80c152b6ee0 100755
--- a/eclass/tests/distutils-r1_single.sh
+++ b/eclass/tests/distutils-r1_single.sh
@@ -39,6 +39,37 @@ test-distutils_enable_tests() {
tend ${ret}
}
+test-DISTUTILS_USE_SETUPTOOLS() {
+ local DISTUTILS_USE_SETUPTOOLS=${1}
+ local exp_BDEPEND=${2}
+ local exp_RDEPEND=${3}
+
+ tbegin "${1}"
+
+ local BDEPEND=
+ local RDEPEND=
+ unset _DISTUTILS_R1
+ inherit distutils-r1
+
+ local ret var val
+ for var in BDEPEND RDEPEND; do
+ local exp_var=exp_${var}
+ # (this normalizes whitespace)
+ read -d $'\0' -r -a val <<<"${!var}"
+ val=${val[*]}
+ if [[ ${val} != "${!exp_var}" ]]; then
+ eindent
+ eerror "${var} expected: ${!exp_var}"
+ eerror "${var} actual: ${val}"
+ eoutdent
+ ret=1
+ tret=1
+ fi
+ done
+
+ tend ${ret}
+}
+
DISTUTILS_USE_SETUPTOOLS=no
DISTUTILS_SINGLE_IMPL=1
inherit distutils-r1
@@ -78,4 +109,14 @@ eoutdent
eoutdent
+einfo DISTUTILS_USE_SETUPTOOLS
+eindent
+SETUPTOOLS_DEP="python_single_target_python3_8? ( >=dev-python/setuptools-42.0.2[python_targets_python3_8(-)] )"
+test-DISTUTILS_USE_SETUPTOOLS no "${BASE_DEPS}" "${BASE_DEPS}"
+test-DISTUTILS_USE_SETUPTOOLS bdepend "${BASE_DEPS} ${SETUPTOOLS_DEP}" "${BASE_DEPS}"
+test-DISTUTILS_USE_SETUPTOOLS rdepend "${BASE_DEPS} ${SETUPTOOLS_DEP}" "${BASE_DEPS} ${SETUPTOOLS_DEP}"
+test-DISTUTILS_USE_SETUPTOOLS pyproject.toml "${BASE_DEPS} python_single_target_python3_8? ( dev-python/pyproject2setuppy[python_targets_python3_8(-)] )" "${BASE_DEPS}"
+test-DISTUTILS_USE_SETUPTOOLS manual "${BASE_DEPS}" "${BASE_DEPS}"
+eoutdent
+
texit
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2020-11-23 18:11 Ulrich Müller
0 siblings, 0 replies; 94+ messages in thread
From: Ulrich Müller @ 2020-11-23 18:11 UTC (permalink / raw
To: gentoo-commits
commit: 754aa946555ccc3f6657922d91a1d2c34b419053
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 17 20:13:14 2020 +0000
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Mon Nov 23 18:01:12 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=754aa946
eclass/tests: Initial test cases for eapi8-dosym.eclass.
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
eclass/tests/eapi8-dosym.sh | 78 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 78 insertions(+)
diff --git a/eclass/tests/eapi8-dosym.sh b/eclass/tests/eapi8-dosym.sh
new file mode 100755
index 00000000000..e1160c42d87
--- /dev/null
+++ b/eclass/tests/eapi8-dosym.sh
@@ -0,0 +1,78 @@
+#!/bin/bash
+# Copyright 2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+source tests-common.sh
+
+inherit eapi8-dosym
+
+dosym() {
+ echo "$1"
+}
+
+# reference implementation using GNU realpath
+ref_canonicalize() {
+ realpath -m -s "$1"
+}
+
+ref_dosym_r() {
+ local link=$(realpath -m -s "/${2#/}")
+ realpath -m -s --relative-to="$(dirname "${link}")" "$1"
+}
+
+randompath() {
+ dd if=/dev/urandom bs=128 count=1 2>/dev/null | LC_ALL=C sed \
+ -e 's/[^a-zA-M]//g;s/[A-E]/\/.\//g;s/[F-J]/\/..\//g;s/[K-M]/\//g' \
+ -e 's/^/\//;q'
+}
+
+teq() {
+ local expected=$1; shift
+ tbegin "$* -> ${expected}"
+ local got=$("$@")
+ [[ ${got} == "${expected}" ]]
+ tend $? "returned: ${got}"
+}
+
+for f in ref_canonicalize "_dosym8_canonicalize"; do
+ # canonicalize absolute paths
+ teq / ${f} /
+ teq /foo/baz/quux ${f} /foo/bar/../baz/quux
+ teq /foo ${f} /../../../foo
+ teq /bar ${f} /foo//./..///bar
+ teq /baz ${f} /foo/bar/../../../baz
+ teq /a/d/f/g ${f} /a/b/c/../../d/e/../f/g
+done
+
+# canonicalize relative paths (not actually used)
+teq . _dosym8_canonicalize .
+teq foo _dosym8_canonicalize foo
+teq foo _dosym8_canonicalize ./foo
+teq ../foo _dosym8_canonicalize ../foo
+teq ../baz _dosym8_canonicalize foo/bar/../../../baz
+
+for f in ref_dosym_r "dosym8 -r"; do
+ teq ../../bin/foo ${f} /bin/foo /usr/bin/foo
+ teq ../../../doc/foo-1 \
+ ${f} /usr/share/doc/foo-1 /usr/share/texmf-site/doc/fonts/foo
+ teq ../../opt/bar/foo ${f} /opt/bar/foo /usr/bin/foo
+ teq ../c/d/e ${f} /a/b/c/d/e a/b/f/g
+ teq b/f ${f} /a/b///./c/d/../e/..//../f /a/././///g/../h
+ teq ../h ${f} /a/././///g/../h /a/b///./c/d/../e/..//../f
+ teq . ${f} /foo /foo/bar
+ teq .. ${f} /foo /foo/bar/baz
+ teq '../../fo . o/b ar' ${f} '/fo . o/b ar' '/baz / qu .. ux/qu x'
+ teq '../../f"o\o/b$a[]r' ${f} '/f"o\o/b$a[]r' '/ba\z/qu$u"x/qux'
+done
+
+# set RANDOMTESTS to a positive number to enable random tests
+for (( i = 0; i < RANDOMTESTS; i++ )); do
+ targ=$(randompath)
+ link=$(randompath)
+ out=$(ref_dosym_r "${targ}" "${link}")
+ teq "${out}" dosym8 -r "${targ}" "${link}"
+done
+
+texit
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2021-03-28 11:48 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2021-03-28 11:48 UTC (permalink / raw
To: gentoo-commits
commit: e7474dec0dcc7c6dd20f4e0feaeda380f4bacd47
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 28 11:48:13 2021 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Mar 28 11:48:41 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e7474dec
eclass/tests: Update distutils-r1 expected values
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/distutils-r1.sh | 4 ++--
eclass/tests/distutils-r1_single.sh | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/eclass/tests/distutils-r1.sh b/eclass/tests/distutils-r1.sh
index 93496f9ac00..163a509b306 100755
--- a/eclass/tests/distutils-r1.sh
+++ b/eclass/tests/distutils-r1.sh
@@ -108,7 +108,7 @@ test-distutils_enable_tests pytest \
test-distutils_enable_tests nose \
"${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( >=dev-python/nose-1.3.7-r4[${PYTHON_USEDEP}] )"
test-distutils_enable_tests unittest \
- "${BASE_IUSE}" "" "${BASE_DEPS}"
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( dev-python/unittest-or-fail[${PYTHON_USEDEP}] )"
test-distutils_enable_tests setup.py \
"${BASE_IUSE}" "" "${BASE_DEPS}"
eoutdent
@@ -122,7 +122,7 @@ test-distutils_enable_tests pytest \
test-distutils_enable_tests nose \
"${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} >=dev-python/nose-1.3.7-r4[${PYTHON_USEDEP}] )"
test-distutils_enable_tests unittest \
- "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} )"
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} dev-python/unittest-or-fail[${PYTHON_USEDEP}] )"
test-distutils_enable_tests setup.py \
"${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} )"
eoutdent
diff --git a/eclass/tests/distutils-r1_single.sh b/eclass/tests/distutils-r1_single.sh
index 80c152b6ee0..fb177261d0a 100755
--- a/eclass/tests/distutils-r1_single.sh
+++ b/eclass/tests/distutils-r1_single.sh
@@ -88,7 +88,7 @@ test-distutils_enable_tests pytest \
test-distutils_enable_tests nose \
"${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( python_single_target_python3_8? ( >=dev-python/nose-1.3.7-r4[python_targets_python3_8(-)] ) )"
test-distutils_enable_tests unittest \
- "${BASE_IUSE}" "" "${BASE_DEPS}"
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( python_single_target_python3_8? ( dev-python/unittest-or-fail[python_targets_python3_8(-)] ) )"
test-distutils_enable_tests setup.py \
"${BASE_IUSE}" "" "${BASE_DEPS}"
eoutdent
@@ -102,7 +102,7 @@ test-distutils_enable_tests pytest \
test-distutils_enable_tests nose \
"${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} python_single_target_python3_8? ( >=dev-python/nose-1.3.7-r4[python_targets_python3_8(-)] ) )"
test-distutils_enable_tests unittest \
- "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} )"
+ "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} python_single_target_python3_8? ( dev-python/unittest-or-fail[python_targets_python3_8(-)] ) )"
test-distutils_enable_tests setup.py \
"${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} )"
eoutdent
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2021-05-05 18:20 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2021-05-05 18:20 UTC (permalink / raw
To: gentoo-commits
commit: 582746d036443f3965028d564e05fd12ca4f10cf
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed May 5 18:00:53 2021 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed May 5 18:01:08 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=582746d0
eclass/tests/python-utils-r1.sh: Cover py3.10
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/python-utils-r1.sh | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh
index eb8223ec6ac..85a6a53654d 100755
--- a/eclass/tests/python-utils-r1.sh
+++ b/eclass/tests/python-utils-r1.sh
@@ -129,6 +129,20 @@ fi
test_var PYTHON_PKG_DEP python3_9 '*dev-lang/python*:3.9'
test_var PYTHON_SCRIPTDIR python3_9 /usr/lib/python-exec/python3.9
+test_var EPYTHON python3_10 python3.10
+test_var PYTHON python3_10 /usr/bin/python3.10
+if [[ -x /usr/bin/python3.10 ]]; then
+ abiflags=$(/usr/bin/python3.10 -c 'import sysconfig; print(sysconfig.get_config_var("ABIFLAGS"))')
+ test_var PYTHON_SITEDIR python3_10 "/usr/lib/python3.10/site-packages"
+ test_var PYTHON_INCLUDEDIR python3_10 "/usr/include/python3.10${abiflags}"
+ test_var PYTHON_LIBPATH python3_10 "/usr/lib*/libpython3.10${abiflags}$(get_libname)"
+ test_var PYTHON_CONFIG python3_10 "/usr/bin/python3.10${abiflags}-config"
+ test_var PYTHON_CFLAGS python3_10 "*-I/usr/include/python3.10*"
+ test_var PYTHON_LIBS python3_10 "*-lpython3.10*"
+fi
+test_var PYTHON_PKG_DEP python3_10 '*dev-lang/python*:3.10'
+test_var PYTHON_SCRIPTDIR python3_10 /usr/lib/python-exec/python3.10
+
test_var EPYTHON pypy3 pypy3
test_var PYTHON pypy3 /usr/bin/pypy3
if [[ -x /usr/bin/pypy3 ]]; then
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2021-05-12 19:39 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2021-05-12 19:39 UTC (permalink / raw
To: gentoo-commits
commit: 66cf9baaae38c512f6cfe7166610cb47a9944016
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed May 12 19:38:26 2021 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed May 12 19:39:03 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=66cf9baa
eclass/tests: Add EAPI decls to fix running tests
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/autotools_eaclocal_amflags.sh | 4 +++-
eclass/tests/flag-o-matic.sh | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/eclass/tests/autotools_eaclocal_amflags.sh b/eclass/tests/autotools_eaclocal_amflags.sh
index b39f5420c31..f9f02bb7789 100755
--- a/eclass/tests/autotools_eaclocal_amflags.sh
+++ b/eclass/tests/autotools_eaclocal_amflags.sh
@@ -1,9 +1,11 @@
#!/bin/bash
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
source tests-common.sh
+EAPI=7
+
inherit autotools
test-it() {
diff --git a/eclass/tests/flag-o-matic.sh b/eclass/tests/flag-o-matic.sh
index 676cc690c75..dc8cfd375c1 100755
--- a/eclass/tests/flag-o-matic.sh
+++ b/eclass/tests/flag-o-matic.sh
@@ -1,9 +1,11 @@
#!/bin/bash
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
source tests-common.sh
+EAPI=7
+
inherit flag-o-matic
CFLAGS="-a -b -c=1 --param l1-cache-size=32"
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2021-05-12 20:55 Mike Gilbert
0 siblings, 0 replies; 94+ messages in thread
From: Mike Gilbert @ 2021-05-12 20:55 UTC (permalink / raw
To: gentoo-commits
commit: b13d8ea802f395645a7364088a1a74738e7aecda
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Wed May 12 20:12:03 2021 +0000
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Wed May 12 20:54:56 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b13d8ea8
eclass/tests: eat optional arguments passed to has_version
portageq has_version does not understand arguments like -b or
--host-root.
This fixes tests for autotools.eclass.
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
eclass/tests/tests-common.sh | 3 +++
1 file changed, 3 insertions(+)
diff --git a/eclass/tests/tests-common.sh b/eclass/tests/tests-common.sh
index 2fc849cb69a..a677842b6ac 100644
--- a/eclass/tests/tests-common.sh
+++ b/eclass/tests/tests-common.sh
@@ -61,6 +61,9 @@ die() {
}
has_version() {
+ while [[ $1 == -* ]]; do
+ shift
+ done
portageq has_version / "$@"
}
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2021-06-22 20:44 David Seifert
0 siblings, 0 replies; 94+ messages in thread
From: David Seifert @ 2021-06-22 20:44 UTC (permalink / raw
To: gentoo-commits
commit: e60eb42c4e5bd3e9cf0d023e87f4925de66556e2
Author: David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 22 20:43:32 2021 +0000
Commit: David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Tue Jun 22 20:43:32 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e60eb42c
eclass/tests: Add EAPI decls to fix running tests
Signed-off-by: David Seifert <soap <AT> gentoo.org>
eclass/tests/linux-info_get_running_version.sh | 3 ++-
eclass/tests/multilib.sh | 3 ++-
eclass/tests/multiprocessing_makeopts_jobs.sh | 3 ++-
eclass/tests/multiprocessing_makeopts_loadavg.sh | 3 ++-
eclass/tests/scons-utils.sh | 3 ++-
eclass/tests/toolchain-funcs.sh | 3 ++-
6 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/eclass/tests/linux-info_get_running_version.sh b/eclass/tests/linux-info_get_running_version.sh
index fbb5c827a45..ce65ae51fee 100755
--- a/eclass/tests/linux-info_get_running_version.sh
+++ b/eclass/tests/linux-info_get_running_version.sh
@@ -1,7 +1,8 @@
#!/bin/bash
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
+EAPI=6
source tests-common.sh
inherit linux-info
diff --git a/eclass/tests/multilib.sh b/eclass/tests/multilib.sh
index a483d4bef36..ce2b4c2a583 100755
--- a/eclass/tests/multilib.sh
+++ b/eclass/tests/multilib.sh
@@ -1,7 +1,8 @@
#!/bin/bash
-# Copyright 2020 Gentoo Authors
+# Copyright 2020-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
+EAPI=7
source tests-common.sh
inherit multilib
diff --git a/eclass/tests/multiprocessing_makeopts_jobs.sh b/eclass/tests/multiprocessing_makeopts_jobs.sh
index 689313a397b..b045121cfa1 100755
--- a/eclass/tests/multiprocessing_makeopts_jobs.sh
+++ b/eclass/tests/multiprocessing_makeopts_jobs.sh
@@ -1,7 +1,8 @@
#!/bin/bash
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
+EAPI=7
source tests-common.sh
inherit multiprocessing
diff --git a/eclass/tests/multiprocessing_makeopts_loadavg.sh b/eclass/tests/multiprocessing_makeopts_loadavg.sh
index d17d7734b9f..28e5e557601 100755
--- a/eclass/tests/multiprocessing_makeopts_loadavg.sh
+++ b/eclass/tests/multiprocessing_makeopts_loadavg.sh
@@ -1,7 +1,8 @@
#!/bin/bash
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
+EAPI=7
source tests-common.sh
inherit multiprocessing
diff --git a/eclass/tests/scons-utils.sh b/eclass/tests/scons-utils.sh
index 873312f67d0..c329cf1bcbd 100755
--- a/eclass/tests/scons-utils.sh
+++ b/eclass/tests/scons-utils.sh
@@ -1,7 +1,8 @@
#!/bin/bash
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
+EAPI=7
source tests-common.sh
inherit scons-utils
diff --git a/eclass/tests/toolchain-funcs.sh b/eclass/tests/toolchain-funcs.sh
index 23ac568c4a5..f78ecc4ebaa 100755
--- a/eclass/tests/toolchain-funcs.sh
+++ b/eclass/tests/toolchain-funcs.sh
@@ -1,7 +1,8 @@
#!/bin/bash
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
+EAPI=7
source tests-common.sh
inherit toolchain-funcs
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2021-12-31 9:10 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2021-12-31 9:10 UTC (permalink / raw
To: gentoo-commits
commit: 2faf25df671629e393ccae66c98683bd3521cbb2
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 31 09:04:58 2021 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Dec 31 09:04:58 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2faf25df
eclass/tests: Update expected deps in distutils-r1 tests
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/distutils-r1.sh | 6 +++---
eclass/tests/distutils-r1_single.sh | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/eclass/tests/distutils-r1.sh b/eclass/tests/distutils-r1.sh
index 163a509b3068..1ccb1dfbc523 100755
--- a/eclass/tests/distutils-r1.sh
+++ b/eclass/tests/distutils-r1.sh
@@ -97,7 +97,7 @@ tend
einfo distutils_enable_tests
eindent
BASE_IUSE="python_targets_python3_8"
-BASE_DEPS="python_targets_python3_8? ( dev-lang/python:3.8 ) >=dev-lang/python-exec-2:=[python_targets_python3_8(-)?,-python_single_target_python3_8(-)]"
+BASE_DEPS="python_targets_python3_8? ( dev-lang/python:3.8 ) >=dev-lang/python-exec-2:=[python_targets_python3_8(-)?]"
TEST_RESTRICT="!test? ( test )"
einfo "empty RDEPEND"
@@ -131,11 +131,11 @@ eoutdent
einfo DISTUTILS_USE_SETUPTOOLS
eindent
-SETUPTOOLS_DEP=">=dev-python/setuptools-42.0.2[python_targets_python3_8(-)?,-python_single_target_python3_8(-)]"
+SETUPTOOLS_DEP=">=dev-python/setuptools-42.0.2[python_targets_python3_8(-)?]"
test-DISTUTILS_USE_SETUPTOOLS no "${BASE_DEPS}" "${BASE_DEPS}"
test-DISTUTILS_USE_SETUPTOOLS bdepend "${BASE_DEPS} ${SETUPTOOLS_DEP}" "${BASE_DEPS}"
test-DISTUTILS_USE_SETUPTOOLS rdepend "${BASE_DEPS} ${SETUPTOOLS_DEP}" "${BASE_DEPS} ${SETUPTOOLS_DEP}"
-test-DISTUTILS_USE_SETUPTOOLS pyproject.toml "${BASE_DEPS} dev-python/pyproject2setuppy[python_targets_python3_8(-)?,-python_single_target_python3_8(-)]" "${BASE_DEPS}"
+test-DISTUTILS_USE_SETUPTOOLS pyproject.toml "${BASE_DEPS} >=dev-python/pyproject2setuppy-22[python_targets_python3_8(-)?]" "${BASE_DEPS}"
test-DISTUTILS_USE_SETUPTOOLS manual "${BASE_DEPS}" "${BASE_DEPS}"
eoutdent
diff --git a/eclass/tests/distutils-r1_single.sh b/eclass/tests/distutils-r1_single.sh
index fb177261d0a0..56b62ca0e90f 100755
--- a/eclass/tests/distutils-r1_single.sh
+++ b/eclass/tests/distutils-r1_single.sh
@@ -115,7 +115,7 @@ SETUPTOOLS_DEP="python_single_target_python3_8? ( >=dev-python/setuptools-42.0.2
test-DISTUTILS_USE_SETUPTOOLS no "${BASE_DEPS}" "${BASE_DEPS}"
test-DISTUTILS_USE_SETUPTOOLS bdepend "${BASE_DEPS} ${SETUPTOOLS_DEP}" "${BASE_DEPS}"
test-DISTUTILS_USE_SETUPTOOLS rdepend "${BASE_DEPS} ${SETUPTOOLS_DEP}" "${BASE_DEPS} ${SETUPTOOLS_DEP}"
-test-DISTUTILS_USE_SETUPTOOLS pyproject.toml "${BASE_DEPS} python_single_target_python3_8? ( dev-python/pyproject2setuppy[python_targets_python3_8(-)] )" "${BASE_DEPS}"
+test-DISTUTILS_USE_SETUPTOOLS pyproject.toml "${BASE_DEPS} python_single_target_python3_8? ( >=dev-python/pyproject2setuppy-22[python_targets_python3_8(-)] )" "${BASE_DEPS}"
test-DISTUTILS_USE_SETUPTOOLS manual "${BASE_DEPS}" "${BASE_DEPS}"
eoutdent
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2021-12-31 9:10 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2021-12-31 9:10 UTC (permalink / raw
To: gentoo-commits
commit: 7d07fee32109260cfa3018c29a3a45d589a82d60
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 31 09:09:34 2021 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Dec 31 09:09:34 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7d07fee3
eclass/tests/python-utils-r1.sh: Remove obsoletep py2 usage
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/python-utils-r1.sh | 46 ++++++++++-------------------------------
1 file changed, 11 insertions(+), 35 deletions(-)
diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh
index 1cd5cdbf6c0a..7ba4a864ff10 100755
--- a/eclass/tests/python-utils-r1.sh
+++ b/eclass/tests/python-utils-r1.sh
@@ -162,68 +162,44 @@ test_is "python_is_python3 pypy" 1
test_is "python_is_python3 pypy3" 0
# generic shebangs
-test_fix_shebang '#!/usr/bin/python' python2.7 '#!/usr/bin/python2.7'
test_fix_shebang '#!/usr/bin/python' python3.6 '#!/usr/bin/python3.6'
test_fix_shebang '#!/usr/bin/python' pypy3 '#!/usr/bin/pypy3'
# python2/python3 matching
-test_fix_shebang '#!/usr/bin/python2' python2.7 '#!/usr/bin/python2.7'
-test_fix_shebang '#!/usr/bin/python3' python2.7 FAIL
-test_fix_shebang '#!/usr/bin/python3' python2.7 '#!/usr/bin/python2.7' --force
test_fix_shebang '#!/usr/bin/python3' python3.6 '#!/usr/bin/python3.6'
test_fix_shebang '#!/usr/bin/python2' python3.6 FAIL
test_fix_shebang '#!/usr/bin/python2' python3.6 '#!/usr/bin/python3.6' --force
# pythonX.Y matching (those mostly test the patterns)
-test_fix_shebang '#!/usr/bin/python2.7' python2.7 '#!/usr/bin/python2.7'
test_fix_shebang '#!/usr/bin/python2.7' python3.2 FAIL
test_fix_shebang '#!/usr/bin/python2.7' python3.2 '#!/usr/bin/python3.2' --force
test_fix_shebang '#!/usr/bin/python3.2' python3.2 '#!/usr/bin/python3.2'
-test_fix_shebang '#!/usr/bin/python3.2' python2.7 FAIL
-test_fix_shebang '#!/usr/bin/python3.2' python2.7 '#!/usr/bin/python2.7' --force
-test_fix_shebang '#!/usr/bin/pypy' python2.7 FAIL
-test_fix_shebang '#!/usr/bin/pypy' python2.7 '#!/usr/bin/python2.7' --force
# fancy path handling
test_fix_shebang '#!/mnt/python2/usr/bin/python' python3.6 \
'#!/mnt/python2/usr/bin/python3.6'
-test_fix_shebang '#!/mnt/python2/usr/bin/python2' python2.7 \
- '#!/mnt/python2/usr/bin/python2.7'
-test_fix_shebang '#!/mnt/python2/usr/bin/env python' python2.7 \
- '#!/mnt/python2/usr/bin/env python2.7'
-test_fix_shebang '#!/mnt/python2/usr/bin/python2 python2' python2.7 \
- '#!/mnt/python2/usr/bin/python2.7 python2'
-test_fix_shebang '#!/mnt/python2/usr/bin/python3 python2' python2.7 FAIL
-test_fix_shebang '#!/mnt/python2/usr/bin/python3 python2' python2.7 \
- '#!/mnt/python2/usr/bin/python2.7 python2' --force
-test_fix_shebang '#!/usr/bin/foo' python2.7 FAIL
+test_fix_shebang '#!/mnt/python2/usr/bin/python3' python3.8 \
+ '#!/mnt/python2/usr/bin/python3.8'
+test_fix_shebang '#!/mnt/python2/usr/bin/env python' python3.8 \
+ '#!/mnt/python2/usr/bin/env python3.8'
+test_fix_shebang '#!/mnt/python2/usr/bin/python3 python3' python3.8 \
+ '#!/mnt/python2/usr/bin/python3.8 python3'
+test_fix_shebang '#!/mnt/python2/usr/bin/python2 python3' python3.8 FAIL
+test_fix_shebang '#!/mnt/python2/usr/bin/python2 python3' python3.8 \
+ '#!/mnt/python2/usr/bin/python3.8 python3' --force
+test_fix_shebang '#!/usr/bin/foo' python3.8 FAIL
# regression test for bug #522080
-test_fix_shebang '#!/usr/bin/python ' python2.7 '#!/usr/bin/python2.7 '
+test_fix_shebang '#!/usr/bin/python ' python3.8 '#!/usr/bin/python3.8 '
# check _python_impl_matches behavior
-test_is "_python_impl_matches python2_7 -2" 0
-test_is "_python_impl_matches python3_6 -2" 1
-test_is "_python_impl_matches python3_7 -2" 1
-test_is "_python_impl_matches pypy3 -2" 1
-test_is "_python_impl_matches python2_7 -3" 1
test_is "_python_impl_matches python3_6 -3" 0
test_is "_python_impl_matches python3_7 -3" 0
test_is "_python_impl_matches pypy3 -3" 0
-test_is "_python_impl_matches python2_7 -2 python3_6" 0
-test_is "_python_impl_matches python3_6 -2 python3_6" 0
-test_is "_python_impl_matches python3_7 -2 python3_6" 1
-test_is "_python_impl_matches pypy3 -2 python3_6" 1
-test_is "_python_impl_matches python2_7 pypy3 -2 python3_6" 0
-test_is "_python_impl_matches python3_6 pypy3 -2 python3_6" 0
-test_is "_python_impl_matches python3_7 pypy3 -2 python3_6" 1
-test_is "_python_impl_matches pypy3 pypy3 -2 python3_6" 0
set -f
-test_is "_python_impl_matches python2_7 pypy*" 1
test_is "_python_impl_matches python3_6 pypy*" 1
test_is "_python_impl_matches python3_7 pypy*" 1
test_is "_python_impl_matches pypy3 pypy*" 0
-test_is "_python_impl_matches python2_7 python*" 0
test_is "_python_impl_matches python3_6 python*" 0
test_is "_python_impl_matches python3_7 python*" 0
test_is "_python_impl_matches pypy3 python*" 1
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2021-12-31 9:10 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2021-12-31 9:10 UTC (permalink / raw
To: gentoo-commits
commit: 85ad470eafdfe9971bb57bbdfed33aad0df964d4
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 31 09:06:01 2021 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Dec 31 09:06:01 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=85ad470e
eclass/tests/python-utils-r1.sh: Update expected pypy3 includedir
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/python-utils-r1.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh
index 63a94c90b715..1cd5cdbf6c0a 100755
--- a/eclass/tests/python-utils-r1.sh
+++ b/eclass/tests/python-utils-r1.sh
@@ -151,7 +151,7 @@ test_var EPYTHON pypy3 pypy3
test_var PYTHON pypy3 /usr/bin/pypy3
if [[ -x /usr/bin/pypy3 ]]; then
test_var PYTHON_SITEDIR pypy3 "/usr/lib*/pypy3.?/site-packages"
- test_var PYTHON_INCLUDEDIR pypy3 "/usr/lib*/pypy3.?/include"
+ test_var PYTHON_INCLUDEDIR pypy3 "/usr/include/pypy3.?"
fi
test_var PYTHON_PKG_DEP pypy3 '*dev-python/pypy3*:0='
test_var PYTHON_SCRIPTDIR pypy3 /usr/lib/python-exec/pypy3
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2022-02-14 17:25 Mike Gilbert
0 siblings, 0 replies; 94+ messages in thread
From: Mike Gilbert @ 2022-02-14 17:25 UTC (permalink / raw
To: gentoo-commits
commit: 318f4a2e9b59083194ac34389a1ca29fce3c969b
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 14 17:20:39 2022 +0000
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Mon Feb 14 17:24:57 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=318f4a2e
eclass/tests/savedconfig.sh: abort when source tests-common.sh fails
Closes: https://bugs.gentoo.org/833342
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
eclass/tests/savedconfig.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/eclass/tests/savedconfig.sh b/eclass/tests/savedconfig.sh
index 7643cf4cc823..16645fc05854 100755
--- a/eclass/tests/savedconfig.sh
+++ b/eclass/tests/savedconfig.sh
@@ -4,7 +4,7 @@
EAPI=7
-source tests-common.sh
+source tests-common.sh || exit
inherit savedconfig
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2022-02-14 21:13 Mike Gilbert
0 siblings, 0 replies; 94+ messages in thread
From: Mike Gilbert @ 2022-02-14 21:13 UTC (permalink / raw
To: gentoo-commits
commit: c1f9ddbdceb036b79881625403917aaeeb608190
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 14 21:12:31 2022 +0000
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Mon Feb 14 21:12:31 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c1f9ddbd
eclass/tests: source tests-common.sh || exit
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
eclass/tests/autotools_eaclocal_amflags.sh | 2 +-
eclass/tests/distutils-r1.sh | 2 +-
eclass/tests/distutils-r1_single.sh | 2 +-
eclass/tests/eapi7-ver.sh | 2 +-
eclass/tests/eapi7-ver_benchmark.sh | 2 +-
eclass/tests/eapi8-dosym.sh | 2 +-
eclass/tests/estack_eshopts.sh | 2 +-
eclass/tests/estack_estack.sh | 2 +-
eclass/tests/estack_evar.sh | 2 +-
eclass/tests/flag-o-matic.sh | 2 +-
eclass/tests/git-r3.sh | 2 +-
eclass/tests/git-r3_GIT_DIR.sh | 2 +-
eclass/tests/git-r3_subrepos.sh | 2 +-
eclass/tests/linux-info_get_running_version.sh | 2 +-
eclass/tests/llvm.sh | 2 +-
eclass/tests/multilib.sh | 2 +-
eclass/tests/multiprocessing_makeopts_jobs.sh | 2 +-
eclass/tests/multiprocessing_makeopts_loadavg.sh | 2 +-
eclass/tests/python-utils-r1.sh | 2 +-
eclass/tests/qmail.sh | 2 +-
eclass/tests/rebar_fix_include_path.sh | 2 +-
eclass/tests/rebar_remove_deps.sh | 2 +-
eclass/tests/rebar_set_vsn.sh | 2 +-
eclass/tests/scons-utils.sh | 2 +-
eclass/tests/toolchain-funcs.sh | 2 +-
eclass/tests/toolchain.sh | 2 +-
eclass/tests/versionator_version_compare.sh | 2 +-
27 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/eclass/tests/autotools_eaclocal_amflags.sh b/eclass/tests/autotools_eaclocal_amflags.sh
index f9f02bb77893..b64f857ec102 100755
--- a/eclass/tests/autotools_eaclocal_amflags.sh
+++ b/eclass/tests/autotools_eaclocal_amflags.sh
@@ -2,7 +2,7 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-source tests-common.sh
+source tests-common.sh || exit
EAPI=7
diff --git a/eclass/tests/distutils-r1.sh b/eclass/tests/distutils-r1.sh
index cd768066bf37..a42d4cc4641a 100755
--- a/eclass/tests/distutils-r1.sh
+++ b/eclass/tests/distutils-r1.sh
@@ -4,7 +4,7 @@
EAPI=7
PYTHON_COMPAT=( python3_8 )
-source tests-common.sh
+source tests-common.sh || exit
test-phase_name_free() {
local ph=${1}
diff --git a/eclass/tests/distutils-r1_single.sh b/eclass/tests/distutils-r1_single.sh
index fdeba2e2b9b2..0a671e2b739b 100755
--- a/eclass/tests/distutils-r1_single.sh
+++ b/eclass/tests/distutils-r1_single.sh
@@ -4,7 +4,7 @@
EAPI=7
PYTHON_COMPAT=( python3_8 )
-source tests-common.sh
+source tests-common.sh || exit
test-distutils_enable_tests() {
local runner=${1}
diff --git a/eclass/tests/eapi7-ver.sh b/eclass/tests/eapi7-ver.sh
index d4aa4fdbd289..13cd671e7158 100755
--- a/eclass/tests/eapi7-ver.sh
+++ b/eclass/tests/eapi7-ver.sh
@@ -4,7 +4,7 @@
EAPI=6
-source tests-common.sh
+source tests-common.sh || exit
inherit eapi7-ver
diff --git a/eclass/tests/eapi7-ver_benchmark.sh b/eclass/tests/eapi7-ver_benchmark.sh
index c46713713368..ab324edb95c9 100755
--- a/eclass/tests/eapi7-ver_benchmark.sh
+++ b/eclass/tests/eapi7-ver_benchmark.sh
@@ -4,7 +4,7 @@
EAPI=6
-source tests-common.sh
+source tests-common.sh || exit
inherit eapi7-ver versionator
diff --git a/eclass/tests/eapi8-dosym.sh b/eclass/tests/eapi8-dosym.sh
index e1160c42d875..9290026a26de 100755
--- a/eclass/tests/eapi8-dosym.sh
+++ b/eclass/tests/eapi8-dosym.sh
@@ -4,7 +4,7 @@
EAPI=7
-source tests-common.sh
+source tests-common.sh || exit
inherit eapi8-dosym
diff --git a/eclass/tests/estack_eshopts.sh b/eclass/tests/estack_eshopts.sh
index 28346c65ec13..c070e99b6569 100755
--- a/eclass/tests/estack_eshopts.sh
+++ b/eclass/tests/estack_eshopts.sh
@@ -2,7 +2,7 @@
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-source tests-common.sh
+source tests-common.sh || exit
inherit estack
diff --git a/eclass/tests/estack_estack.sh b/eclass/tests/estack_estack.sh
index 4845243d3ae4..18d337ec1f0c 100755
--- a/eclass/tests/estack_estack.sh
+++ b/eclass/tests/estack_estack.sh
@@ -2,7 +2,7 @@
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-source tests-common.sh
+source tests-common.sh || exit
inherit estack
diff --git a/eclass/tests/estack_evar.sh b/eclass/tests/estack_evar.sh
index 29badba0079e..1bf35f2d6e0e 100755
--- a/eclass/tests/estack_evar.sh
+++ b/eclass/tests/estack_evar.sh
@@ -2,7 +2,7 @@
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-source tests-common.sh
+source tests-common.sh || exit
inherit estack
diff --git a/eclass/tests/flag-o-matic.sh b/eclass/tests/flag-o-matic.sh
index dc8cfd375c1e..1e4bfdb2fcfe 100755
--- a/eclass/tests/flag-o-matic.sh
+++ b/eclass/tests/flag-o-matic.sh
@@ -2,7 +2,7 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-source tests-common.sh
+source tests-common.sh || exit
EAPI=7
diff --git a/eclass/tests/git-r3.sh b/eclass/tests/git-r3.sh
index 2f452bfd68a8..02cbcbc59125 100755
--- a/eclass/tests/git-r3.sh
+++ b/eclass/tests/git-r3.sh
@@ -7,7 +7,7 @@ exit 0
EAPI=7
-source tests-common.sh
+source tests-common.sh || exit
inherit git-r3
diff --git a/eclass/tests/git-r3_GIT_DIR.sh b/eclass/tests/git-r3_GIT_DIR.sh
index c17ae7bb43c0..2c9fa07b7041 100755
--- a/eclass/tests/git-r3_GIT_DIR.sh
+++ b/eclass/tests/git-r3_GIT_DIR.sh
@@ -4,7 +4,7 @@
EAPI=7
-source tests-common.sh
+source tests-common.sh || exit
inherit git-r3
diff --git a/eclass/tests/git-r3_subrepos.sh b/eclass/tests/git-r3_subrepos.sh
index 0fcf1cd08081..76dbb1981bfc 100755
--- a/eclass/tests/git-r3_subrepos.sh
+++ b/eclass/tests/git-r3_subrepos.sh
@@ -4,7 +4,7 @@
EAPI=7
-source tests-common.sh
+source tests-common.sh || exit
inherit git-r3
diff --git a/eclass/tests/linux-info_get_running_version.sh b/eclass/tests/linux-info_get_running_version.sh
index ce65ae51fee9..57aaf2fedcd4 100755
--- a/eclass/tests/linux-info_get_running_version.sh
+++ b/eclass/tests/linux-info_get_running_version.sh
@@ -3,7 +3,7 @@
# Distributed under the terms of the GNU General Public License v2
EAPI=6
-source tests-common.sh
+source tests-common.sh || exit
inherit linux-info
diff --git a/eclass/tests/llvm.sh b/eclass/tests/llvm.sh
index 8527d81765dd..93bc124a82af 100755
--- a/eclass/tests/llvm.sh
+++ b/eclass/tests/llvm.sh
@@ -3,7 +3,7 @@
# Distributed under the terms of the GNU General Public License v2
EAPI=7
-source tests-common.sh
+source tests-common.sh || exit
inherit llvm
diff --git a/eclass/tests/multilib.sh b/eclass/tests/multilib.sh
index ce2b4c2a5833..95be9530881e 100755
--- a/eclass/tests/multilib.sh
+++ b/eclass/tests/multilib.sh
@@ -3,7 +3,7 @@
# Distributed under the terms of the GNU General Public License v2
EAPI=7
-source tests-common.sh
+source tests-common.sh || exit
inherit multilib
diff --git a/eclass/tests/multiprocessing_makeopts_jobs.sh b/eclass/tests/multiprocessing_makeopts_jobs.sh
index b045121cfa17..70a6085d5362 100755
--- a/eclass/tests/multiprocessing_makeopts_jobs.sh
+++ b/eclass/tests/multiprocessing_makeopts_jobs.sh
@@ -3,7 +3,7 @@
# Distributed under the terms of the GNU General Public License v2
EAPI=7
-source tests-common.sh
+source tests-common.sh || exit
inherit multiprocessing
diff --git a/eclass/tests/multiprocessing_makeopts_loadavg.sh b/eclass/tests/multiprocessing_makeopts_loadavg.sh
index 28e5e557601a..d6e4bf0451fb 100755
--- a/eclass/tests/multiprocessing_makeopts_loadavg.sh
+++ b/eclass/tests/multiprocessing_makeopts_loadavg.sh
@@ -3,7 +3,7 @@
# Distributed under the terms of the GNU General Public License v2
EAPI=7
-source tests-common.sh
+source tests-common.sh || exit
inherit multiprocessing
diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh
index 0244ce26ad0f..8c733b22294e 100755
--- a/eclass/tests/python-utils-r1.sh
+++ b/eclass/tests/python-utils-r1.sh
@@ -3,7 +3,7 @@
# Distributed under the terms of the GNU General Public License v2
EAPI=7
-source tests-common.sh
+source tests-common.sh || exit
eqawarn() {
: # stub
diff --git a/eclass/tests/qmail.sh b/eclass/tests/qmail.sh
index 3520ed2a9d5b..8cf0abdae1a6 100755
--- a/eclass/tests/qmail.sh
+++ b/eclass/tests/qmail.sh
@@ -3,7 +3,7 @@
# Distributed under the terms of the GNU General Public License v2
EAPI=8
-source tests-common.sh
+source tests-common.sh || exit
inherit qmail
diff --git a/eclass/tests/rebar_fix_include_path.sh b/eclass/tests/rebar_fix_include_path.sh
index 8164e39d7252..339633e91e3a 100755
--- a/eclass/tests/rebar_fix_include_path.sh
+++ b/eclass/tests/rebar_fix_include_path.sh
@@ -2,7 +2,7 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-source tests-common.sh
+source tests-common.sh || exit
EAPI=6
diff --git a/eclass/tests/rebar_remove_deps.sh b/eclass/tests/rebar_remove_deps.sh
index 1b877b33929b..b544a3078dbb 100755
--- a/eclass/tests/rebar_remove_deps.sh
+++ b/eclass/tests/rebar_remove_deps.sh
@@ -2,7 +2,7 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-source tests-common.sh
+source tests-common.sh || exit
EAPI=6
diff --git a/eclass/tests/rebar_set_vsn.sh b/eclass/tests/rebar_set_vsn.sh
index 315d8a76ec4b..c828732b0079 100755
--- a/eclass/tests/rebar_set_vsn.sh
+++ b/eclass/tests/rebar_set_vsn.sh
@@ -2,7 +2,7 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-source tests-common.sh
+source tests-common.sh || exit
EAPI=6
diff --git a/eclass/tests/scons-utils.sh b/eclass/tests/scons-utils.sh
index c329cf1bcbd1..32a0a944706e 100755
--- a/eclass/tests/scons-utils.sh
+++ b/eclass/tests/scons-utils.sh
@@ -3,7 +3,7 @@
# Distributed under the terms of the GNU General Public License v2
EAPI=7
-source tests-common.sh
+source tests-common.sh || exit
inherit scons-utils
diff --git a/eclass/tests/toolchain-funcs.sh b/eclass/tests/toolchain-funcs.sh
index f78ecc4ebaab..56379b10cded 100755
--- a/eclass/tests/toolchain-funcs.sh
+++ b/eclass/tests/toolchain-funcs.sh
@@ -3,7 +3,7 @@
# Distributed under the terms of the GNU General Public License v2
EAPI=7
-source tests-common.sh
+source tests-common.sh || exit
inherit toolchain-funcs
diff --git a/eclass/tests/toolchain.sh b/eclass/tests/toolchain.sh
index 8e070cad4b98..c012448a1478 100755
--- a/eclass/tests/toolchain.sh
+++ b/eclass/tests/toolchain.sh
@@ -8,7 +8,7 @@ EAPI=5
TOOLCHAIN_GCC_PV=7.3.0
PR=r0
-source tests-common.sh
+source tests-common.sh || exit
inherit toolchain
diff --git a/eclass/tests/versionator_version_compare.sh b/eclass/tests/versionator_version_compare.sh
index c7a238cf9d1e..2875c0f693da 100755
--- a/eclass/tests/versionator_version_compare.sh
+++ b/eclass/tests/versionator_version_compare.sh
@@ -2,7 +2,7 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-source tests-common.sh
+source tests-common.sh || exit
inherit versionator
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2022-04-19 21:32 Mike Gilbert
0 siblings, 0 replies; 94+ messages in thread
From: Mike Gilbert @ 2022-04-19 21:32 UTC (permalink / raw
To: gentoo-commits
commit: 74780679b37fc00aa39804d8cc3a90abf6e2c745
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 19 21:31:52 2022 +0000
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Tue Apr 19 21:31:52 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=74780679
eclass/tests/qmail.sh: eend and return should be separate statements
Closes: https://bugs.gentoo.org/839189
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
eclass/tests/qmail.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/eclass/tests/qmail.sh b/eclass/tests/qmail.sh
index 8cf0abdae1a6..16e52741c23c 100755
--- a/eclass/tests/qmail.sh
+++ b/eclass/tests/qmail.sh
@@ -13,7 +13,8 @@ test_low_numbers() {
for i in $(seq 0 6); do
if is_prime ${i}; then
- return tend 1 "${i} badly accepted"
+ tend 1 "${i} badly accepted"
+ return
fi
done
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2022-04-21 15:19 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2022-04-21 15:19 UTC (permalink / raw
To: gentoo-commits
commit: 5ebae81ccb112276cf260007c99f18069063c0be
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 21 08:41:06 2022 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Apr 21 15:19:40 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5ebae81c
eclass/tests/python-utils-r1.sh: Add tests for stdlib ver matching
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/python-utils-r1.sh | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh
index ef7687b8a9cf..9c41798c4727 100755
--- a/eclass/tests/python-utils-r1.sh
+++ b/eclass/tests/python-utils-r1.sh
@@ -223,6 +223,15 @@ test_is "_python_impl_matches python3_6 python*" 0
test_is "_python_impl_matches python3_7 python*" 0
test_is "_python_impl_matches pypy3 python*" 1
set +f
+test_is "_python_impl_matches python3_8 3.8" 0
+test_is "_python_impl_matches python3_8 3.9" 1
+test_is "_python_impl_matches python3_8 3.10" 1
+test_is "_python_impl_matches python3_9 3.8" 1
+test_is "_python_impl_matches python3_9 3.9" 0
+test_is "_python_impl_matches python3_9 3.10" 1
+test_is "_python_impl_matches pypy3 3.8" 1
+test_is "_python_impl_matches pypy3 3.9" 0
+test_is "_python_impl_matches pypy3 3.10" 1
rm "${tmpfile}"
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2022-05-09 20:33 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2022-05-09 20:33 UTC (permalink / raw
To: gentoo-commits
commit: 3f4aa7b89404ad751b7d4da2e272ee61b1554010
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun May 8 10:20:59 2022 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon May 9 20:31:46 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3f4aa7b8
eclass/tests/python-utils-r1.sh: Streamline the tests
Streamline the python-utils-r1.eclass tests to use a for loop instead
of copying the same tests over and over again. While at it, group tests
by purpose.
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/python-utils-r1.sh | 112 ++++++++++------------------------------
1 file changed, 28 insertions(+), 84 deletions(-)
diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh
index e0fc0aab3c03..d971c524b373 100755
--- a/eclass/tests/python-utils-r1.sh
+++ b/eclass/tests/python-utils-r1.sh
@@ -64,6 +64,8 @@ tmpfile=$(mktemp)
inherit python-utils-r1
+ebegin "Testing python2.7"
+eindent
test_var EPYTHON python2_7 python2.7
test_var PYTHON python2_7 /usr/bin/python2.7
if [[ -x /usr/bin/python2.7 ]]; then
@@ -76,91 +78,29 @@ if [[ -x /usr/bin/python2.7 ]]; then
fi
test_var PYTHON_PKG_DEP python2_7 '*dev-lang/python*:2.7'
test_var PYTHON_SCRIPTDIR python2_7 /usr/lib/python-exec/python2.7
+eoutdent
-test_var EPYTHON python3_6 python3.6
-test_var PYTHON python3_6 /usr/bin/python3.6
-if [[ -x /usr/bin/python3.6 ]]; then
- abiflags=$(/usr/bin/python3.6 -c 'import sysconfig; print(sysconfig.get_config_var("ABIFLAGS"))')
- test_var PYTHON_SITEDIR python3_6 "/usr/lib*/python3.6/site-packages"
- test_var PYTHON_INCLUDEDIR python3_6 "/usr/include/python3.6${abiflags}"
- test_var PYTHON_LIBPATH python3_6 "/usr/lib*/libpython3.6${abiflags}$(get_libname)"
- test_var PYTHON_CONFIG python3_6 "/usr/bin/python3.6${abiflags}-config"
- test_var PYTHON_CFLAGS python3_6 "*-I/usr/include/python3.6*"
- test_var PYTHON_LIBS python3_6 "*-lpython3.6*"
-fi
-test_var PYTHON_PKG_DEP python3_6 '*dev-lang/python*:3.6'
-test_var PYTHON_SCRIPTDIR python3_6 /usr/lib/python-exec/python3.6
-
-test_var EPYTHON python3_7 python3.7
-test_var PYTHON python3_7 /usr/bin/python3.7
-if [[ -x /usr/bin/python3.7 ]]; then
- abiflags=$(/usr/bin/python3.7 -c 'import sysconfig; print(sysconfig.get_config_var("ABIFLAGS"))')
- test_var PYTHON_SITEDIR python3_7 "/usr/lib/python3.7/site-packages"
- test_var PYTHON_INCLUDEDIR python3_7 "/usr/include/python3.7${abiflags}"
- test_var PYTHON_LIBPATH python3_7 "/usr/lib*/libpython3.7${abiflags}$(get_libname)"
- test_var PYTHON_CONFIG python3_7 "/usr/bin/python3.7${abiflags}-config"
- test_var PYTHON_CFLAGS python3_7 "*-I/usr/include/python3.7*"
- test_var PYTHON_LIBS python3_7 "*-lpython3.7*"
-fi
-test_var PYTHON_PKG_DEP python3_7 '*dev-lang/python*:3.7'
-test_var PYTHON_SCRIPTDIR python3_7 /usr/lib/python-exec/python3.7
-
-test_var EPYTHON python3_8 python3.8
-test_var PYTHON python3_8 /usr/bin/python3.8
-if [[ -x /usr/bin/python3.8 ]]; then
- abiflags=$(/usr/bin/python3.8 -c 'import sysconfig; print(sysconfig.get_config_var("ABIFLAGS"))')
- test_var PYTHON_SITEDIR python3_8 "/usr/lib/python3.8/site-packages"
- test_var PYTHON_INCLUDEDIR python3_8 "/usr/include/python3.8${abiflags}"
- test_var PYTHON_LIBPATH python3_8 "/usr/lib*/libpython3.8${abiflags}$(get_libname)"
- test_var PYTHON_CONFIG python3_8 "/usr/bin/python3.8${abiflags}-config"
- test_var PYTHON_CFLAGS python3_8 "*-I/usr/include/python3.8*"
- test_var PYTHON_LIBS python3_8 "*-lpython3.8*"
-fi
-test_var PYTHON_PKG_DEP python3_8 '*dev-lang/python*:3.8'
-test_var PYTHON_SCRIPTDIR python3_8 /usr/lib/python-exec/python3.8
-
-test_var EPYTHON python3_9 python3.9
-test_var PYTHON python3_9 /usr/bin/python3.9
-if [[ -x /usr/bin/python3.9 ]]; then
- abiflags=$(/usr/bin/python3.9 -c 'import sysconfig; print(sysconfig.get_config_var("ABIFLAGS"))')
- test_var PYTHON_SITEDIR python3_9 "/usr/lib/python3.9/site-packages"
- test_var PYTHON_INCLUDEDIR python3_9 "/usr/include/python3.9${abiflags}"
- test_var PYTHON_LIBPATH python3_9 "/usr/lib*/libpython3.9${abiflags}$(get_libname)"
- test_var PYTHON_CONFIG python3_9 "/usr/bin/python3.9${abiflags}-config"
- test_var PYTHON_CFLAGS python3_9 "*-I/usr/include/python3.9*"
- test_var PYTHON_LIBS python3_9 "*-lpython3.9*"
-fi
-test_var PYTHON_PKG_DEP python3_9 '*dev-lang/python*:3.9'
-test_var PYTHON_SCRIPTDIR python3_9 /usr/lib/python-exec/python3.9
-
-test_var EPYTHON python3_10 python3.10
-test_var PYTHON python3_10 /usr/bin/python3.10
-if [[ -x /usr/bin/python3.10 ]]; then
- abiflags=$(/usr/bin/python3.10 -c 'import sysconfig; print(sysconfig.get_config_var("ABIFLAGS"))')
- test_var PYTHON_SITEDIR python3_10 "/usr/lib/python3.10/site-packages"
- test_var PYTHON_INCLUDEDIR python3_10 "/usr/include/python3.10${abiflags}"
- test_var PYTHON_LIBPATH python3_10 "/usr/lib*/libpython3.10${abiflags}$(get_libname)"
- test_var PYTHON_CONFIG python3_10 "/usr/bin/python3.10${abiflags}-config"
- test_var PYTHON_CFLAGS python3_10 "*-I/usr/include/python3.10*"
- test_var PYTHON_LIBS python3_10 "*-lpython3.10*"
-fi
-test_var PYTHON_PKG_DEP python3_10 '*dev-lang/python*:3.10'
-test_var PYTHON_SCRIPTDIR python3_10 /usr/lib/python-exec/python3.10
-
-test_var EPYTHON python3_11 python3.11
-test_var PYTHON python3_11 /usr/bin/python3.11
-if [[ -x /usr/bin/python3.11 ]]; then
- abiflags=$(/usr/bin/python3.11 -c 'import sysconfig; print(sysconfig.get_config_var("ABIFLAGS"))')
- test_var PYTHON_SITEDIR python3_11 "/usr/lib/python3.11/site-packages"
- test_var PYTHON_INCLUDEDIR python3_11 "/usr/include/python3.11${abiflags}"
- test_var PYTHON_LIBPATH python3_11 "/usr/lib*/libpython3.11${abiflags}$(get_libname)"
- test_var PYTHON_CONFIG python3_11 "/usr/bin/python3.11${abiflags}-config"
- test_var PYTHON_CFLAGS python3_11 "*-I/usr/include/python3.11*"
- test_var PYTHON_LIBS python3_11 "*-lpython3.11*"
-fi
-test_var PYTHON_PKG_DEP python3_11 '*dev-lang/python*:3.11'
-test_var PYTHON_SCRIPTDIR python3_11 /usr/lib/python-exec/python3.11
+for minor in 6 7 8 9 10 11; do
+ ebegin "Testing python3.${minor}"
+ eindent
+ test_var EPYTHON "python3_${minor}" "python3.${minor}"
+ test_var PYTHON "python3_${minor}" "/usr/bin/python3.${minor}"
+ if [[ -x /usr/bin/python3.${minor} ]]; then
+ abiflags=$(/usr/bin/python3.${minor} -c 'import sysconfig; print(sysconfig.get_config_var("ABIFLAGS"))')
+ test_var PYTHON_SITEDIR "python3_${minor}" "/usr/lib*/python3.${minor}/site-packages"
+ test_var PYTHON_INCLUDEDIR "python3_${minor}" "/usr/include/python3.${minor}${abiflags}"
+ test_var PYTHON_LIBPATH "python3_${minor}" "/usr/lib*/libpython3.${minor}${abiflags}$(get_libname)"
+ test_var PYTHON_CONFIG "python3_${minor}" "/usr/bin/python3.${minor}${abiflags}-config"
+ test_var PYTHON_CFLAGS "python3_${minor}" "*-I/usr/include/python3.${minor}*"
+ test_var PYTHON_LIBS "python3_${minor}" "*-lpython3.${minor}*"
+ fi
+ test_var PYTHON_PKG_DEP "python3_${minor}" "*dev-lang/python*:3.${minor}"
+ test_var PYTHON_SCRIPTDIR "python3_${minor}" "/usr/lib/python-exec/python3.${minor}"
+ eoutdent
+done
+ebegin "Testing pypy3"
+eindent
test_var EPYTHON pypy3 pypy3
test_var PYTHON pypy3 /usr/bin/pypy3
if [[ -x /usr/bin/pypy3 ]]; then
@@ -169,9 +109,10 @@ if [[ -x /usr/bin/pypy3 ]]; then
fi
test_var PYTHON_PKG_DEP pypy3 '*dev-python/pypy3*:0='
test_var PYTHON_SCRIPTDIR pypy3 /usr/lib/python-exec/pypy3
+eoutdent
for EPREFIX in '' /foo; do
- einfo "with EPREFIX=${EPREFIX@Q}"
+ einfo "Testing python_fix_shebang with EPREFIX=${EPREFIX@Q}"
eindent
# generic shebangs
test_fix_shebang '#!/usr/bin/python' python3.6 \
@@ -226,6 +167,8 @@ for EPREFIX in '' /foo; do
done
# check _python_impl_matches behavior
+einfo "Testing python_impl_matches"
+eindent
test_is "_python_impl_matches python3_6 -3" 0
test_is "_python_impl_matches python3_7 -3" 0
test_is "_python_impl_matches pypy3 -3" 0
@@ -246,6 +189,7 @@ test_is "_python_impl_matches python3_9 3.10" 1
test_is "_python_impl_matches pypy3 3.8" 1
test_is "_python_impl_matches pypy3 3.9" 0
test_is "_python_impl_matches pypy3 3.10" 1
+eoutdent
rm "${tmpfile}"
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2022-05-09 20:33 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2022-05-09 20:33 UTC (permalink / raw
To: gentoo-commits
commit: f77482477e16fb380a1fe29bbbf88ba9d343a1ac
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun May 8 10:37:57 2022 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon May 9 20:31:47 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f7748247
eclass/tests/python-utils-r1.eclass: Add tests for adding new impls
Add tests that verify that new Python implementations are added to all
the places that need them.
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/python-utils-r1.sh | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh
index d971c524b373..6abf10cadabd 100755
--- a/eclass/tests/python-utils-r1.sh
+++ b/eclass/tests/python-utils-r1.sh
@@ -96,6 +96,41 @@ for minor in 6 7 8 9 10 11; do
fi
test_var PYTHON_PKG_DEP "python3_${minor}" "*dev-lang/python*:3.${minor}"
test_var PYTHON_SCRIPTDIR "python3_${minor}" "/usr/lib/python-exec/python3.${minor}"
+
+ tbegin "Testing that python3_${minor} is present in an impl array"
+ has "python3_${minor}" "${_PYTHON_ALL_IMPLS[@]}"
+ has_in_all=${?}
+ has "python3_${minor}" "${_PYTHON_HISTORICAL_IMPLS[@]}"
+ has_in_historical=${?}
+ if [[ ${has_in_all} -eq ${has_in_historical} ]]; then
+ if [[ ${has_in_all} -eq 1 ]]; then
+ eerror "python3_${minor} not found in _PYTHON_ALL_IMPLS or _PYTHON_HISTORICAL_IMPLS"
+ else
+ eerror "python3_${minor} listed both in _PYTHON_ALL_IMPLS and _PYTHON_HISTORICAL_IMPLS"
+ fi
+ fi
+ tend ${?}
+
+ tbegin "Testing that PYTHON_COMPAT accepts the impl"
+ (
+ # NB: we add pypy3 as we need to always have at least one
+ # non-historical impl
+ PYTHON_COMPAT=( pypy3 "python3_${minor}" )
+ _python_set_impls
+ )
+ tend ${?}
+
+ # these tests apply to py3.8+ only
+ if [[ ${minor} -ge 8 ]]; then
+ tbegin "Testing that _python_verify_patterns accepts stdlib version"
+ ( _python_verify_patterns "3.${minor}" )
+ tend ${?}
+
+ tbegin "Testing _python_impl_matches on stdlib version"
+ _python_impl_matches "python3_${minor}" "3.${minor}"
+ tend ${?}
+ fi
+
eoutdent
done
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2022-09-27 20:28 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2022-09-27 20:28 UTC (permalink / raw
To: gentoo-commits
commit: 9f8718d9175ede151365ae0472bfc25e0e7e451f
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 24 13:43:43 2022 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Sep 27 20:27:55 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9f8718d9
eclass/tests: Add tests for unpacker.eclass
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/tests-common.sh | 7 ++
eclass/tests/unpacker.sh | 233 +++++++++++++++++++++++++++++++++++++++++++
2 files changed, 240 insertions(+)
diff --git a/eclass/tests/tests-common.sh b/eclass/tests/tests-common.sh
index a677842b6ac5..45b1e20b933a 100644
--- a/eclass/tests/tests-common.sh
+++ b/eclass/tests/tests-common.sh
@@ -60,6 +60,13 @@ die() {
exit 1
}
+assert() {
+ local x pipestatus=${PIPESTATUS[*]}
+ for x in ${pipestatus} ; do
+ [[ ${x} -eq 0 ]] || die "$@"
+ done
+}
+
has_version() {
while [[ $1 == -* ]]; do
shift
diff --git a/eclass/tests/unpacker.sh b/eclass/tests/unpacker.sh
new file mode 100755
index 000000000000..7a297d61babd
--- /dev/null
+++ b/eclass/tests/unpacker.sh
@@ -0,0 +1,233 @@
+#!/usr/bin/env bash
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+source tests-common.sh || exit
+
+inherit unpacker
+
+# silence the output
+unpack_banner() { :; }
+
+TESTFILE=test.in
+TESTDIR=$(mktemp -d || die)
+trap 'cd - >/dev/null && rm -r "${TESTDIR}"' EXIT
+
+# prepare some test data
+# NB: we need something "compressible", as compress(1) will return
+# an error if the file "is larger than before compression"
+cp ../unpacker.eclass "${TESTDIR}/${TESTFILE}" || die
+cd "${TESTDIR}" || die
+
+test_unpack() {
+ local archive=${1}
+ local unpacked=${2}
+ local deps=${3}
+ local packcmd=${4}
+
+ local x
+ for x in ${deps}; do
+ if ! type "${x}" &>/dev/null; then
+ ewarn "Skipping ${archive}, tool ${x} not found"
+ return
+ fi
+ done
+
+ rm -rf testdir || die
+ mkdir -p testdir || die
+
+ tbegin "unpacking ${archive}"
+ eval "${packcmd}"
+ assert "packing ${archive} failed"
+ cd testdir || die
+ local out
+ out=$(
+ _unpacker "../${archive}" 2>&1
+ )
+ ret=$?
+ if [[ ${ret} -eq 0 ]]; then
+ if [[ ! -f ${unpacked} ]]; then
+ eerror "${unpacked} not found after unpacking"
+ ret=1
+ elif ! diff -u "${unpacked}" "../${TESTFILE}"; then
+ eerror "${unpacked} different than input"
+ ret=1
+ fi
+ fi
+ [[ ${ret} -ne 0 ]] && echo "${out}" >&2
+ tend ${ret}
+
+ cd .. || die
+ rm -f "${archive}" || die
+}
+
+test_compressed_file() {
+ local suffix=${1}
+ local tool=${2}
+
+ test_unpack "test${suffix}" test "${tool}" \
+ "${tool} -c \${TESTFILE} > \${archive}"
+}
+
+test_compressed_file_multistream() {
+ local suffix=${1}
+ local tool=${2}
+
+ test_unpack "test+multistream${suffix}" "test+multistream" "${tool}" \
+ "head -n 300 \${TESTFILE} | ${tool} -c > \${archive} &&
+ tail -n +301 \${TESTFILE} | ${tool} -c >> \${archive}"
+}
+
+test_compressed_file_with_junk() {
+ local suffix=${1}
+ local tool=${2}
+ local flag=${3}
+
+ test_unpack "test+junk${suffix}" "test+junk" "${tool}" \
+ "${tool} -c \${TESTFILE} > \${archive} && cat test.in >> \${archive}"
+}
+
+test_compressed_tar() {
+ local suffix=${1}
+ local tool=${2}
+
+ test_unpack "test${suffix}" test.in "tar ${tool}" \
+ "tar -c \${TESTFILE} | ${tool} -c > \${archive}"
+}
+
+test_compressed_cpio() {
+ local suffix=${1}
+ local tool=${2}
+
+ test_unpack "test${suffix}" test.in "cpio ${tool}" \
+ "cpio -o --quiet <<<\${TESTFILE} | ${tool} -c > \${archive}"
+}
+
+create_deb() {
+ local suffix=${1}
+ local tool=${2}
+ local archive=${3}
+ local infile=${4}
+
+ echo 2.0 > debian-binary || die
+ : > control || die
+ tar -cf control.tar control || die
+ tar -c "${infile}" | ${tool} > "data.tar${suffix}"
+ assert "packing data.tar${suffix} failed"
+ ar r "${archive}" debian-binary control.tar "data.tar${suffix}" \
+ 2>/dev/null || die
+ rm -f control control.tar "data.tar${suffix}" debian-binary || die
+}
+
+test_deb() {
+ local suffix=${1}
+ local tool=${2}
+ local tool_cmd
+
+ if [[ -n ${tool} ]]; then
+ tool_cmd="${tool} -c"
+ else
+ tool_cmd=cat
+ fi
+
+ test_unpack "test-${tool}_1.2.3_noarch.deb" test.in "ar tar ${tool}" \
+ "create_deb '${suffix}' '${tool_cmd}' \${archive} \${TESTFILE}"
+}
+
+test_reject_junk() {
+ local suffix=${1}
+ local archive=test${1}
+
+ rm -rf testdir || die
+ mkdir -p testdir || die
+
+ tbegin "rejecting junk named ${archive}"
+ cat test.in >> "${archive}" || die
+ cd testdir || die
+ (
+ # some decompressors (e.g. cpio) are very verbose about junk
+ _unpacker "../${archive}" &>/dev/null
+ )
+ [[ $? -ne 0 ]]
+ ret=$?
+ tend ${ret}
+
+ cd .. || die
+ rm -f "${archive}" || die
+}
+
+test_compressed_file .bz2 bzip2
+test_compressed_file .Z compress
+test_compressed_file .gz gzip
+test_compressed_file .lzma lzma
+test_compressed_file .xz xz
+test_compressed_file .lz lzip
+test_compressed_file .zst zstd
+
+test_compressed_file_multistream .bz2 bzip2
+test_compressed_file_multistream .gz gzip
+test_compressed_file_multistream .xz xz
+test_compressed_file_multistream .lz lzip
+test_compressed_file_multistream .zst zstd
+
+test_compressed_file_with_junk .bz2 bzip2
+test_compressed_file_with_junk .lz lzip
+
+test_unpack test.tar test.in tar 'tar -cf ${archive} ${TESTFILE}'
+test_compressed_tar .tar.bz2 bzip2
+test_compressed_tar .tbz bzip2
+test_compressed_tar .tbz2 bzip2
+test_compressed_tar .tar.Z compress
+test_compressed_tar .tar.gz gzip
+test_compressed_tar .tgz gzip
+test_compressed_tar .tar.lzma lzma
+test_compressed_tar .tar.xz xz
+test_compressed_tar .txz xz
+test_compressed_tar .tar.lz lzip
+test_compressed_tar .tar.zst zstd
+
+test_unpack test.cpio test.in cpio 'cpio -o --quiet <<<${TESTFILE} > ${archive}'
+test_compressed_cpio .cpio.bz2 bzip2
+test_compressed_cpio .cpio.Z compress
+test_compressed_cpio .cpio.gz gzip
+test_compressed_cpio .cpio.lzma lzma
+test_compressed_cpio .cpio.xz xz
+test_compressed_cpio .cpio.lz lzip
+test_compressed_cpio .cpio.zst zstd
+
+test_deb
+test_deb .gz gzip
+test_deb .xz xz
+test_deb .bz2 bzip2
+test_deb .lzma lzma
+
+test_unpack test.zip test.in zip 'zip -q ${archive} ${TESTFILE}'
+# test handling non-adjusted zip with junk prepended
+test_unpack test.zip test.in zip \
+ 'zip -q testdir/tmp.zip ${TESTFILE} && cat test.in testdir/tmp.zip > ${archive}'
+test_unpack test.7z test.in 7z '7z -bso0 a ${archive} ${TESTFILE}'
+test_unpack test.lha test.in lha 'lha a -q ${archive} ${TESTFILE}'
+test_unpack test.lzh test.in lha 'lha a -q ${archive} ${TESTFILE}'
+test_unpack test.rar test.in rar 'rar -idq a ${archive} ${TESTFILE}'
+
+# TODO: .run/.sh/.bin
+
+test_reject_junk .bz2
+test_reject_junk .Z
+test_reject_junk .gz
+test_reject_junk .lzma
+test_reject_junk .xz
+test_reject_junk .lz
+test_reject_junk .zst
+test_reject_junk .tar
+test_reject_junk .cpio
+test_reject_junk .deb
+test_reject_junk .zip
+test_reject_junk .7z
+test_reject_junk .rar
+test_reject_junk .lha
+test_reject_junk .lzh
+
+texit
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2022-10-01 17:19 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2022-10-01 17:19 UTC (permalink / raw
To: gentoo-commits
commit: 467e21cbdab04a21e006825a17fd9344f7dcd688
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 28 08:56:16 2022 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Oct 1 17:19:34 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=467e21cb
eclass/tests/unpacker.sh: Add tests for makeself
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/unpacker.sh | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/eclass/tests/unpacker.sh b/eclass/tests/unpacker.sh
index 105f28fd4858..ea9e64d0a4c7 100755
--- a/eclass/tests/unpacker.sh
+++ b/eclass/tests/unpacker.sh
@@ -182,6 +182,25 @@ test_gpkg() {
"create_gpkg '${suffix}' '${tool_cmd}' \${archive} \${TESTFILE}"
}
+create_makeself() {
+ local comp_opt=${1}
+ local archive=${2}
+ local infile=${3}
+
+ mkdir test || die
+ cp "${infile}" test/ || die
+ makeself --quiet "${comp_opt}" test "${archive}" test : || die
+ rm -rf test || die
+}
+
+test_makeself() {
+ local comp_opt=${1}
+ local tool=${2}
+
+ test_unpack "makeself-${tool}.sh" test.in "makeself ${tool}" \
+ "create_makeself '${comp_opt}' \${archive} \${TESTFILE}"
+}
+
test_reject_junk() {
local suffix=${1}
local archive=test${1}
@@ -265,6 +284,16 @@ test_gpkg .lzo lzop
test_gpkg .xz xz
test_gpkg .zst zstd
+test_makeself --gzip gzip
+test_makeself --zstd zstd
+test_makeself --bzip2 bzip2
+test_makeself --xz xz
+test_makeself --lzo lzop
+test_makeself --lz4 lz4
+test_makeself --compress compress
+test_makeself --base64 base64
+test_makeself --nocomp tar
+
test_unpack test.zip test.in zip 'zip -q ${archive} ${TESTFILE}'
# test handling non-adjusted zip with junk prepended
test_unpack test.zip test.in zip \
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2022-10-01 17:19 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2022-10-01 17:19 UTC (permalink / raw
To: gentoo-commits
commit: 8554f11f4bf46147609c710ffb8fac2eef8ccc94
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 29 06:54:44 2022 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Oct 1 17:19:36 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8554f11f
eclass/tests/unpacker.sh: Add online tests for makeself
Closes: https://github.com/gentoo/gentoo/pull/27507
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/unpacker.sh | 105 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 105 insertions(+)
diff --git a/eclass/tests/unpacker.sh b/eclass/tests/unpacker.sh
index ea9e64d0a4c7..ef17e724a851 100755
--- a/eclass/tests/unpacker.sh
+++ b/eclass/tests/unpacker.sh
@@ -223,6 +223,67 @@ test_reject_junk() {
rm -f "${archive}" || die
}
+test_online() {
+ local url=${1}
+ local b2sum=${2}
+ local unpacked=${3}
+ local unp_b2sum=${4}
+
+ local filename=${url##*/}
+ local archive=${DISTDIR}/${filename}
+
+ if [[ ! -f ${archive} ]]; then
+ if [[ ${UNPACKER_TESTS_ONLINE} != 1 ]]; then
+ ewarn "Skipping ${filename} test, distfile not found"
+ return
+ fi
+
+ if ! wget -O "${archive}" "${url}"; then
+ die "Fetching ${archive} failed"
+ fi
+ fi
+
+ local real_sum=$(b2sum "${archive}" | cut -d' ' -f1)
+ if [[ ${real_sum} != ${b2sum} ]]; then
+ eerror "Incorrect b2sum on ${filename}"
+ eerror " expected: ${b2sum}"
+ eerror " found: ${real_sum}"
+ die "Incorrect b2sum on ${filename}"
+ fi
+
+ rm -rf testdir || die
+ mkdir -p testdir || die
+
+ tbegin "unpacking ${filename}"
+ cd testdir || die
+
+ ln -s "${archive}" "${filename}" || die
+
+ local out
+ out=$(
+ _unpacker "${archive}" 2>&1
+ )
+ ret=$?
+ if [[ ${ret} -eq 0 ]]; then
+ if [[ ! -f ${unpacked} ]]; then
+ eerror "${unpacked} not found after unpacking"
+ ret=1
+ else
+ real_sum=$(b2sum "${unpacked}" | cut -d' ' -f1)
+ if [[ ${real_sum} != ${unp_b2sum} ]]; then
+ eerror "Incorrect b2sum on unpacked file ${unpacked}"
+ eerror " expected: ${unp_b2sum}"
+ eerror " found: ${real_sum}"
+ ret=1
+ fi
+ fi
+ fi
+ [[ ${ret} -ne 0 ]] && echo "${out}" >&2
+ tend ${ret}
+
+ cd .. || die
+}
+
test_compressed_file .bz2 bzip2
test_compressed_file .Z compress
test_compressed_file .gz gzip
@@ -322,4 +383,48 @@ test_reject_junk .rar
test_reject_junk .lha
test_reject_junk .lzh
+DISTDIR=$(portageq envvar DISTDIR)
+if [[ -n ${DISTDIR} ]]; then
+ einfo "Using DISTDIR: ${DISTDIR}"
+ if [[ ${UNPACKER_TESTS_ONLINE} != 1 ]]; then
+ ewarn "Online tests will be skipped if distfiles are not found already."
+ ewarn "Set UNPACKER_TESTS_ONLINE=1 to enable fetching."
+ fi
+
+ # NB: a good idea to list the last file in the archive (to avoid
+ # passing on partial unpack)
+
+ # TODO: find test cases for makeself 2.0/2.0.1, 2.1.1, 2.1.2, 2.1.3
+
+ # makeself 1.5.4, gzip
+ test_online \
+ http://updates.lokigames.com/sof/sof-1.06a-cdrom-x86.run \
+ f76f605af08a19b77548455c0101e03aca7cae69462914e47911da2fadd6d4f3b766e1069556ead0d06c757b179ae2e8105e76ea37852f17796b47b4712aec87 \
+ update.sh \
+ ba7a3f8fa79bbed8ca3a34ead957aeaa308c6e6d6aedd603098aa9867ca745983ff98c83d65572e507f2c3c4e0778ae4984f8b69d2b8279741b06064253c5788
+
+ # makeself 1.6.0-nv*, xz
+ test_online \
+ https://download.nvidia.com/XFree86/Linux-x86/390.154/NVIDIA-Linux-x86-390.154.run \
+ 083d9dd234a37ec39a703ef7e0eb6ec165c24d2fcb5e92ca987c33df643d0604319eb65ef152c861acacd5a41858ab6b82c45c2c8ff270efc62b07727666daae \
+ libEGL_nvidia.so.390.154 \
+ 6665804947e71fb583dc7d5cc3a6f4514f612503000b0a9dbd8da5c362d3c2dcb2895d8cbbf5700a6f0e24cca9b0dd9c2cf5763d6fbb037f55257ac5af7d6084
+
+ # makeself 2.3.0, gzip
+ test_online \
+ http://www.sdrplay.com/software/SDRplay_RSP_API-Linux-3.07.1.run \
+ 059d9a5fbd14c0e7ecb969cd3e5afe8e3f42896175b443bdaa9f9108302a1c9ef5ad9769e62f824465611d74f67191fff71cc6dbe297e399e5b2f6824c650112 \
+ i686/sdrplay_apiService \
+ 806393c310d7e60dca7b8afee225bcc50c0d5771bdd04c3fa575eda2e687dc5c888279a7404316438b633fb91565a49899cf634194d43981151a12c6c284a162
+
+ # makeself 2.4.0, gzip
+ test_online \
+ http://www.sdrplay.com/software/SDRplay_RSP_API-Linux-2.13.1.run \
+ 7eff1aa35190db1ead5b1d96994d24ae2301e3a765d6701756c6304a1719aa32125fedacf6a6859d89b89db5dd6956ec0e8c7e814dbd6242db5614a53e89efb3 \
+ sdrplay_license.txt \
+ 041edb26ffb75b6b59e7a3514c6f81b05b06e0efe61cc56117d24f59733a6a6b1bca73a57dd11e0774ec443740ca55e6938cf6594a032ab4f14b23f2e732a3f2
+else
+ ewarn "Unable to obtain DISTDIR from portageq, skipping online tests"
+fi
+
texit
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2022-10-10 20:52 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2022-10-10 20:52 UTC (permalink / raw
To: gentoo-commits
commit: bcce21e5e6b31aca6b2f8edb15328edc8f078d52
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 8 09:41:05 2022 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Oct 10 20:52:36 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bcce21e5
eclass/tests/toolchain-funcs.sh: Handle missing ld.gold gracefully
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/toolchain-funcs.sh | 64 ++++++++++++++++++++++-------------------
1 file changed, 34 insertions(+), 30 deletions(-)
diff --git a/eclass/tests/toolchain-funcs.sh b/eclass/tests/toolchain-funcs.sh
index d8a357fb24fe..08cfd74611aa 100755
--- a/eclass/tests/toolchain-funcs.sh
+++ b/eclass/tests/toolchain-funcs.sh
@@ -60,20 +60,22 @@ tbegin "tc-ld-is-gold (ld=bfd cc=bfd)"
LD=ld.bfd LDFLAGS=-fuse-ld=bfd tc-ld-is-gold && ret=1 || ret=0
tend ${ret}
-tbegin "tc-ld-is-gold (ld=gold cc=default)"
-LD=ld.gold tc-ld-is-gold
-ret=$?
-tend ${ret}
-
-tbegin "tc-ld-is-gold (ld=gold cc=bfd)"
-LD=ld.gold LDFLAGS=-fuse-ld=bfd tc-ld-is-gold
-ret=$?
-tend ${ret}
-
-tbegin "tc-ld-is-gold (ld=bfd cc=gold)"
-LD=ld.bfd LDFLAGS=-fuse-ld=gold tc-ld-is-gold
-ret=$?
-tend ${ret}
+if type -P ld.gold &>/dev/null; then
+ tbegin "tc-ld-is-gold (ld=gold cc=default)"
+ LD=ld.gold tc-ld-is-gold
+ ret=$?
+ tend ${ret}
+
+ tbegin "tc-ld-is-gold (ld=gold cc=bfd)"
+ LD=ld.gold LDFLAGS=-fuse-ld=bfd tc-ld-is-gold
+ ret=$?
+ tend ${ret}
+
+ tbegin "tc-ld-is-gold (ld=bfd cc=gold)"
+ LD=ld.bfd LDFLAGS=-fuse-ld=gold tc-ld-is-gold
+ ret=$?
+ tend ${ret}
+fi
#
# TEST: tc-ld-disable-gold
@@ -87,23 +89,25 @@ tc-ld-disable-gold
)
tend $?
-tbegin "tc-ld-disable-gold (ld=gold)"
-(
-export LD=ld.gold LDFLAGS=
-ewarn() { :; }
-tc-ld-disable-gold
-[[ ${LD} == "ld.bfd" || ${LDFLAGS} == *"-fuse-ld=bfd"* ]]
-)
-tend $?
+if type -P ld.gold &>/dev/null; then
+ tbegin "tc-ld-disable-gold (ld=gold)"
+ (
+ export LD=ld.gold LDFLAGS=
+ ewarn() { :; }
+ tc-ld-disable-gold
+ [[ ${LD} == "ld.bfd" || ${LDFLAGS} == *"-fuse-ld=bfd"* ]]
+ )
+ tend $?
-tbegin "tc-ld-disable-gold (cc=gold)"
-(
-export LD= LDFLAGS="-fuse-ld=gold"
-ewarn() { :; }
-tc-ld-disable-gold
-[[ ${LD} == *"/ld.bfd" || ${LDFLAGS} == "-fuse-ld=gold -fuse-ld=bfd" ]]
-)
-tend $?
+ tbegin "tc-ld-disable-gold (cc=gold)"
+ (
+ export LD= LDFLAGS="-fuse-ld=gold"
+ ewarn() { :; }
+ tc-ld-disable-gold
+ [[ ${LD} == *"/ld.bfd" || ${LDFLAGS} == "-fuse-ld=gold -fuse-ld=bfd" ]]
+ )
+ tend $?
+fi
unset CPP
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2022-10-15 17:35 Mike Gilbert
0 siblings, 0 replies; 94+ messages in thread
From: Mike Gilbert @ 2022-10-15 17:35 UTC (permalink / raw
To: gentoo-commits
commit: 37219aee42de9387e83eb2e2454b4c7b74e5ebbe
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 9 21:16:51 2022 +0000
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sat Oct 15 17:33:50 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=37219aee
eclass/tests: add systemd tests
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
eclass/tests/systemd.sh | 50 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)
diff --git a/eclass/tests/systemd.sh b/eclass/tests/systemd.sh
new file mode 100755
index 000000000000..f870df4b7a12
--- /dev/null
+++ b/eclass/tests/systemd.sh
@@ -0,0 +1,50 @@
+#!/usr/bin/env bash
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+source tests-common.sh || exit
+
+inherit systemd
+
+test_system_dir() {
+ local exp1="${EPREFIX}$1"
+ local exp2="${EPREFIX}/usr$1"
+ shift
+ tbegin "$@"
+ local act=$("$@")
+ [[ ${act} == ${exp1} || ${act} == ${exp2} ]]
+ tend $?
+}
+
+test_user_dir() {
+ local exp="${EPREFIX}$1"
+ shift
+ tbegin "$@"
+ local act=$("$@")
+ [[ ${act} == ${exp} ]]
+ tend $?
+}
+
+test_systemd_unprefix() {
+ local exp=$1
+ local EPREFIX=$2
+ shift 2
+ tbegin "EPREFIX=${EPREFIX} _systemd_unprefix $@"
+ [[ "$(_systemd_unprefix "$@")" == "${exp}" ]]
+ tend $?
+}
+
+test_system_dir /lib/systemd/system systemd_get_systemunitdir
+test_system_dir /lib/systemd systemd_get_utildir
+test_system_dir /lib/systemd/system-generators systemd_get_systemgeneratordir
+test_system_dir /lib/systemd/system-preset systemd_get_systempresetdir
+test_system_dir /lib/systemd/system-sleep systemd_get_sleepdir
+
+test_user_dir /usr/lib/systemd/user systemd_get_userunitdir
+
+test_systemd_unprefix /lib/systemd /prefix echo /prefix/lib/systemd
+test_systemd_unprefix /lib/systemd '' echo /lib/systemd
+test_systemd_unprefix /lib/systemd '/*' echo '/*/lib/systemd'
+
+texit
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2022-10-28 8:24 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2022-10-28 8:24 UTC (permalink / raw
To: gentoo-commits
commit: 2ec095a0bca10ded3361ff2d7494a42ac9f51cfb
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 28 08:24:00 2022 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Oct 28 08:24:00 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2ec095a0
eclass/tests/scons-utils.sh: Fake python-r1 to fix failure
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/scons-utils.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/eclass/tests/scons-utils.sh b/eclass/tests/scons-utils.sh
index 32a0a944706e..5f1cd2036047 100755
--- a/eclass/tests/scons-utils.sh
+++ b/eclass/tests/scons-utils.sh
@@ -3,6 +3,7 @@
# Distributed under the terms of the GNU General Public License v2
EAPI=7
+_PYTHON_R1=1
source tests-common.sh || exit
inherit scons-utils
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2022-12-14 10:18 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2022-12-14 10:18 UTC (permalink / raw
To: gentoo-commits
commit: 0cc7b234854bc82ebf2d20bfe161848a9fe3e6ee
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 12 05:48:37 2022 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Dec 14 10:16:15 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0cc7b234
eclass/tests/python-utils-r1.sh: Remove old impls
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/python-utils-r1.sh | 18 +-----------------
1 file changed, 1 insertion(+), 17 deletions(-)
diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh
index 6abf10cadabd..6a1d2f98cbf9 100755
--- a/eclass/tests/python-utils-r1.sh
+++ b/eclass/tests/python-utils-r1.sh
@@ -64,23 +64,7 @@ tmpfile=$(mktemp)
inherit python-utils-r1
-ebegin "Testing python2.7"
-eindent
-test_var EPYTHON python2_7 python2.7
-test_var PYTHON python2_7 /usr/bin/python2.7
-if [[ -x /usr/bin/python2.7 ]]; then
- test_var PYTHON_SITEDIR python2_7 "/usr/lib*/python2.7/site-packages"
- test_var PYTHON_INCLUDEDIR python2_7 /usr/include/python2.7
- test_var PYTHON_LIBPATH python2_7 "/usr/lib*/libpython2.7$(get_libname)"
- test_var PYTHON_CONFIG python2_7 /usr/bin/python2.7-config
- test_var PYTHON_CFLAGS python2_7 "*-I/usr/include/python2.7*"
- test_var PYTHON_LIBS python2_7 "*-lpython2.7*"
-fi
-test_var PYTHON_PKG_DEP python2_7 '*dev-lang/python*:2.7'
-test_var PYTHON_SCRIPTDIR python2_7 /usr/lib/python-exec/python2.7
-eoutdent
-
-for minor in 6 7 8 9 10 11; do
+for minor in 8 9 10 11; do
ebegin "Testing python3.${minor}"
eindent
test_var EPYTHON "python3_${minor}" "python3.${minor}"
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2023-04-20 23:14 Sam James
0 siblings, 0 replies; 94+ messages in thread
From: Sam James @ 2023-04-20 23:14 UTC (permalink / raw
To: gentoo-commits
commit: 55074a1c37442d3dedf5e65dcb93c8e6d20c6af8
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 20 23:12:51 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Apr 20 23:12:51 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=55074a1c
eclass/tests: partially fix toolchain.eclass tests
- 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 <AT> gentoo.org>
eclass/tests/toolchain.sh | 41 +++++++++++++++++++++--------------------
1 file changed, 21 insertions(+), 20 deletions(-)
diff --git a/eclass/tests/toolchain.sh b/eclass/tests/toolchain.sh
index c012448a1478..1f21e7d842b1 100755
--- a/eclass/tests/toolchain.sh
+++ b/eclass/tests/toolchain.sh
@@ -1,16 +1,17 @@
#!/bin/bash
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=5
+EAPI=8
-# apply exlass globals to test version parsing
-TOOLCHAIN_GCC_PV=7.3.0
+# apply eclass globals to test version parsing
+TOOLCHAIN_GCC_PV=11.3.0
PR=r0
source tests-common.sh || exit
-inherit toolchain
+EAPI=6 inherit eapi7-ver
+EAPI=7 inherit toolchain
# Ignore actually running version of gcc and fake new version
# to force downgrade test on all conditions below.
@@ -120,12 +121,12 @@ test_tc_version_is_at_least() {
}
# want mine expect
-test_tc_version_is_at_least 8 '' 1
-test_tc_version_is_at_least 8.0 '' 1
-test_tc_version_is_at_least 7 '' 0
-test_tc_version_is_at_least 7.0 '' 0
+test_tc_version_is_at_least 12 '' 1
+test_tc_version_is_at_least 11.4 '' 1
+test_tc_version_is_at_least 10 '' 0
+test_tc_version_is_at_least 10 '' 0
test_tc_version_is_at_least ${TOOLCHAIN_GCC_PV} '' 0
-test_tc_version_is_at_least 5.0 6.0 0
+test_tc_version_is_at_least 10 11 0
test_tc_version_is_between() {
local exp msg ret=0 lo hi res
@@ -149,11 +150,11 @@ test_tc_version_is_between() {
# lo hi expect
test_tc_version_is_between 1 0 1
test_tc_version_is_between 1 2 1
-test_tc_version_is_between 7 8 0
-test_tc_version_is_between ${TOOLCHAIN_GCC_PV} 8 0
+test_tc_version_is_between 11 12 0
+test_tc_version_is_between ${TOOLCHAIN_GCC_PV} 12 0
test_tc_version_is_between ${TOOLCHAIN_GCC_PV} ${TOOLCHAIN_GCC_PV} 1
-test_tc_version_is_between 7 ${TOOLCHAIN_GCC_PV} 1
-test_tc_version_is_between 8 9 1
+test_tc_version_is_between 10 ${TOOLCHAIN_GCC_PV} 1
+test_tc_version_is_between 12 13 1
# eclass has a few critical global variables worth not breaking
test_var_assert() {
@@ -173,14 +174,14 @@ test_var_assert() {
# TODO: convert these globals to helpers to ease testing against multiple
# ${TOOLCHAIN_GCC_PV} vaues.
-test_var_assert GCC_PV 7.3.0
-test_var_assert GCC_PVR 7.3.0
-test_var_assert GCC_RELEASE_VER 7.3.0
-test_var_assert GCC_BRANCH_VER 7.3
-test_var_assert GCCMAJOR 7
+test_var_assert GCC_PV 11.3.0
+test_var_assert GCC_PVR 11.3.0
+test_var_assert GCC_RELEASE_VER 11.3.0
+test_var_assert GCC_BRANCH_VER 11.3
+test_var_assert GCCMAJOR 11
test_var_assert GCCMINOR 3
test_var_assert GCCMICRO 0
-test_var_assert GCC_CONFIG_VER 7.3.0
+test_var_assert GCC_CONFIG_VER 11.3.0
test_var_assert PREFIX /usr
texit
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2023-05-01 13:43 Sam James
0 siblings, 0 replies; 94+ messages in thread
From: Sam James @ 2023-05-01 13:43 UTC (permalink / raw
To: gentoo-commits
commit: cc939b81c322279e65f82c8c222dcb54015c65df
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon May 1 11:55:22 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon May 1 13:43:27 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cc939b81
eclass/tests/python-utils-r1.sh: Stop testing python3_9
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
Signed-off-by: Sam James <sam <AT> gentoo.org>
eclass/tests/python-utils-r1.sh | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh
index 9d37bf0b24d0..d8b414219704 100755
--- a/eclass/tests/python-utils-r1.sh
+++ b/eclass/tests/python-utils-r1.sh
@@ -64,7 +64,7 @@ tmpfile=$(mktemp)
inherit python-utils-r1
-for minor in 9 10 11; do
+for minor in 10 11; do
ebegin "Testing python3.${minor}"
eindent
test_var EPYTHON "python3_${minor}" "python3.${minor}"
@@ -199,16 +199,10 @@ test_is "_python_impl_matches python3_6 python*" 0
test_is "_python_impl_matches python3_7 python*" 0
test_is "_python_impl_matches pypy3 python*" 1
set +f
-test_is "_python_impl_matches python3_9 3.9" 0
-test_is "_python_impl_matches python3_9 3.10" 1
-test_is "_python_impl_matches python3_9 3.11" 1
-test_is "_python_impl_matches python3_10 3.9" 1
test_is "_python_impl_matches python3_10 3.10" 0
test_is "_python_impl_matches python3_10 3.11" 1
-test_is "_python_impl_matches python3_11 3.9" 1
test_is "_python_impl_matches python3_11 3.10" 1
test_is "_python_impl_matches python3_11 3.11" 0
-test_is "_python_impl_matches pypy3 3.9" 0
test_is "_python_impl_matches pypy3 3.10" 1
test_is "_python_impl_matches pypy3 3.11" 1
eoutdent
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2023-05-23 4:36 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2023-05-23 4:36 UTC (permalink / raw
To: gentoo-commits
commit: 8ef986658021d85a990d1049039614a29054cc43
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue May 23 04:01:45 2023 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue May 23 04:36:33 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8ef98665
eclass/tests/python-utils-r1.sh: Fix patterns for pypy3.10
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/python-utils-r1.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh
index ee09ae2c877c..635d49decbdd 100755
--- a/eclass/tests/python-utils-r1.sh
+++ b/eclass/tests/python-utils-r1.sh
@@ -123,8 +123,8 @@ eindent
test_var EPYTHON pypy3 pypy3
test_var PYTHON pypy3 /usr/bin/pypy3
if [[ -x /usr/bin/pypy3 ]]; then
- test_var PYTHON_SITEDIR pypy3 "/usr/lib*/pypy3.?/site-packages"
- test_var PYTHON_INCLUDEDIR pypy3 "/usr/include/pypy3.?"
+ test_var PYTHON_SITEDIR pypy3 "/usr/lib*/pypy3.*/site-packages"
+ test_var PYTHON_INCLUDEDIR pypy3 "/usr/include/pypy3.*"
fi
test_var PYTHON_PKG_DEP pypy3 '*dev-python/pypy3*:0='
test_var PYTHON_SCRIPTDIR pypy3 /usr/lib/python-exec/pypy3
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2023-06-15 12:19 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2023-06-15 12:19 UTC (permalink / raw
To: gentoo-commits
commit: d72660faea4dcba0d261fbc80d9c6d62066842bd
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 12 19:44:03 2023 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Jun 15 12:19:22 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d72660fa
eclass/tests: Add pypi-bench.sh for global scope logic
The benchmark yield roughly 327 ops / s on my machine.
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/pypi-bench.sh | 69 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 69 insertions(+)
diff --git a/eclass/tests/pypi-bench.sh b/eclass/tests/pypi-bench.sh
new file mode 100755
index 000000000000..cce93527b729
--- /dev/null
+++ b/eclass/tests/pypi-bench.sh
@@ -0,0 +1,69 @@
+#!/bin/bash
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+source tests-common.sh || exit
+
+export LC_ALL=C
+
+ITERATIONS=1000
+RUNS=3
+
+doit() {
+ local i
+ for (( i = 0; i < ITERATIONS; i++ )); do
+ _pypi_set_globals
+ done
+}
+
+timeit() {
+ einfo "Timing PYPI_PN=\"${PYPI_PN}\" PV=\"${PV}\" PYPI_NO_NORMALIZE=${PYPI_NO_NORMALIZE}"
+
+ local real=()
+ local user=()
+ local x vr avg
+
+ for (( x = 0; x < RUNS; x++ )); do
+ while read tt tv; do
+ case ${tt} in
+ real) real+=( ${tv} );;
+ user) user+=( ${tv} );;
+ esac
+ done < <( ( time -p doit ) 2>&1 )
+ done
+
+ [[ ${#real[@]} == ${RUNS} ]] || die "Did not get ${RUNS} real times"
+ [[ ${#user[@]} == ${RUNS} ]] || die "Did not get ${RUNS} user times"
+
+ local xr avg
+ for x in real user; do
+ xr="${x}[*]"
+ avg=$(dc -S 3 -e "${ITERATIONS} ${RUNS} * ${!xr} + + / p")
+
+ printf '%s %4.0f it/s\n' "${x}" "${avg}"
+ done
+}
+
+PN=foo-bar
+PYPI_PN=Foo.Bar
+PV=1.2.3_beta2
+WORKDIR='<WORKDIR>'
+
+inherit pypi
+timeit
+
+PV=1.2.3
+timeit
+PYPI_NO_NORMALIZE=1 timeit
+
+PN=foobar
+PYPI_PN=FooBar
+timeit
+PYPI_NO_NORMALIZE=1 timeit
+
+PYPI_PN=foobar
+timeit
+PYPI_NO_NORMALIZE=1 timeit
+
+texit
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2023-06-17 10:10 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2023-06-17 10:10 UTC (permalink / raw
To: gentoo-commits
commit: 746642aec3f9380f44bff3c5e8b79acfb105af6b
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 15 12:24:43 2023 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Jun 17 10:10:14 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=746642ae
eclass/tests: Add a benchmark for python-utils-r1
Initial timings on my system:
```
* Timing _python_set_impls
real 1463 it/s
user 1886 it/s
```
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/python-utils-bench.sh | 53 ++++++++++++++++++++++++++++++++++++++
1 file changed, 53 insertions(+)
diff --git a/eclass/tests/python-utils-bench.sh b/eclass/tests/python-utils-bench.sh
new file mode 100755
index 000000000000..7f27adef5509
--- /dev/null
+++ b/eclass/tests/python-utils-bench.sh
@@ -0,0 +1,53 @@
+#!/bin/bash
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+source tests-common.sh || exit
+
+export LC_ALL=C
+
+ITERATIONS=10000
+RUNS=3
+
+doit() {
+ local i
+ for (( i = 0; i < ITERATIONS; i++ )); do
+ "${@}"
+ done
+}
+
+timeit() {
+ local real=()
+ local user=()
+ local x vr avg
+
+ einfo "Timing ${*}"
+ for (( x = 0; x < RUNS; x++ )); do
+ while read tt tv; do
+ case ${tt} in
+ real) real+=( ${tv} );;
+ user) user+=( ${tv} );;
+ esac
+ done < <( ( time -p doit "${@}" ) 2>&1 )
+ done
+
+ [[ ${#real[@]} == ${RUNS} ]] || die "Did not get ${RUNS} real times"
+ [[ ${#user[@]} == ${RUNS} ]] || die "Did not get ${RUNS} user times"
+
+ local xr avg
+ for x in real user; do
+ xr="${x}[*]"
+ avg=$(dc -S 3 -e "${ITERATIONS} ${RUNS} * ${!xr} + + / p")
+
+ printf '%s %4.0f it/s\n' "${x}" "${avg}"
+ done
+}
+
+PYTHON_COMPAT=( python3_{10..12} pypy3 )
+
+inherit python-utils-r1
+
+timeit _python_set_impls
+
+texit
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2023-06-18 14:57 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2023-06-18 14:57 UTC (permalink / raw
To: gentoo-commits
commit: a9d3b1f7d35f9b226a8d8bf35d9e83b1244aa016
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 15 04:32:10 2023 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Jun 18 14:57:43 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a9d3b1f7
eclass/tests: Add a minimal benchmark for cargo.eclass
The initial results on my machine are:
```
real 252 it/s
user 289 it/s
```
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/cargo-bench.sh | 107 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 107 insertions(+)
diff --git a/eclass/tests/cargo-bench.sh b/eclass/tests/cargo-bench.sh
new file mode 100755
index 000000000000..cdc5e4431c14
--- /dev/null
+++ b/eclass/tests/cargo-bench.sh
@@ -0,0 +1,107 @@
+#!/bin/bash
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+source tests-common.sh || exit
+
+export LC_ALL=C
+
+ITERATIONS=1000
+RUNS=3
+
+doit() {
+ for (( i = 0; i < ITERATIONS; i++ )); do
+ SRC_URI="
+ $(cargo_crate_uris)
+ "
+ done
+}
+
+timeit() {
+ local real=()
+ local user=()
+ local x vr avg
+
+ for (( x = 0; x < RUNS; x++ )); do
+ while read tt tv; do
+ case ${tt} in
+ real) real+=( ${tv} );;
+ user) user+=( ${tv} );;
+ esac
+ done < <( ( time -p doit ) 2>&1 )
+ done
+
+ [[ ${#real[@]} == ${RUNS} ]] || die "Did not get ${RUNS} real times"
+ [[ ${#user[@]} == ${RUNS} ]] || die "Did not get ${RUNS} user times"
+
+ local xr avg
+ for x in real user; do
+ xr="${x}[*]"
+ avg=$(dc -S 3 -e "${ITERATIONS} ${RUNS} * ${!xr} + + / p")
+
+ printf '%s %4.0f it/s\n' "${x}" "${avg}"
+ done
+}
+
+# taken from cryptograpy-41.0.1
+CRATES="
+ Inflector-0.11.4
+ aliasable-0.1.3
+ asn1-0.15.2
+ asn1_derive-0.15.2
+ autocfg-1.1.0
+ base64-0.13.1
+ bitflags-1.3.2
+ cc-1.0.79
+ cfg-if-1.0.0
+ foreign-types-0.3.2
+ foreign-types-shared-0.1.1
+ indoc-1.0.9
+ libc-0.2.144
+ lock_api-0.4.9
+ memoffset-0.8.0
+ once_cell-1.17.2
+ openssl-0.10.54
+ openssl-macros-0.1.1
+ openssl-sys-0.9.88
+ ouroboros-0.15.6
+ ouroboros_macro-0.15.6
+ parking_lot-0.12.1
+ parking_lot_core-0.9.7
+ pem-1.1.1
+ pkg-config-0.3.27
+ proc-macro-error-1.0.4
+ proc-macro-error-attr-1.0.4
+ proc-macro2-1.0.59
+ pyo3-0.18.3
+ pyo3-build-config-0.18.3
+ pyo3-ffi-0.18.3
+ pyo3-macros-0.18.3
+ pyo3-macros-backend-0.18.3
+ quote-1.0.28
+ redox_syscall-0.2.16
+ scopeguard-1.1.0
+ smallvec-1.10.0
+ syn-1.0.109
+ syn-2.0.18
+ target-lexicon-0.12.7
+ unicode-ident-1.0.9
+ unindent-0.1.11
+ vcpkg-0.2.15
+ version_check-0.9.4
+ windows-sys-0.45.0
+ windows-targets-0.42.2
+ windows_aarch64_gnullvm-0.42.2
+ windows_aarch64_msvc-0.42.2
+ windows_i686_gnu-0.42.2
+ windows_i686_msvc-0.42.2
+ windows_x86_64_gnu-0.42.2
+ windows_x86_64_gnullvm-0.42.2
+ windows_x86_64_msvc-0.42.2
+"
+
+inherit cargo
+timeit
+
+texit
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2023-09-14 5:30 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2023-09-14 5:30 UTC (permalink / raw
To: gentoo-commits
commit: 4be72bb040d08cae62f9f0ccdd21c307858512a3
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 3 14:45:07 2023 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Sep 14 05:30:10 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4be72bb0
eclass/tests: Add initial tests for verify-sig
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/verify-sig.sh | 65 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 65 insertions(+)
diff --git a/eclass/tests/verify-sig.sh b/eclass/tests/verify-sig.sh
new file mode 100755
index 000000000000..fcd2ee7480a2
--- /dev/null
+++ b/eclass/tests/verify-sig.sh
@@ -0,0 +1,65 @@
+#!/bin/bash
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+source tests-common.sh || exit
+
+inherit verify-sig
+
+TMP=$(mktemp -d)
+trap 'rm -rf "${TMP}"' EXIT
+cd "${TMP}" || die
+> empty || die
+> fail || die
+echo "The quick brown fox jumps over the lazy dog." > text || die
+
+testit() {
+ local expect=${1}
+ shift
+
+ tbegin "${*@Q}"
+ ( "${@}" )
+ [[ ${?} -eq ${expect} ]]
+ tend "${?}"
+}
+
+test_verify_unsigned_checksums() {
+ local format=${1}
+
+ testit 0 verify-sig_verify_unsigned_checksums checksums.txt "${format}" empty
+ testit 0 verify-sig_verify_unsigned_checksums checksums.txt "${format}" "empty text"
+ testit 1 verify-sig_verify_unsigned_checksums checksums.txt "${format}" other
+ testit 1 verify-sig_verify_unsigned_checksums checksums.txt "${format}" "empty other"
+ testit 1 verify-sig_verify_unsigned_checksums checksums.txt "${format}" fail
+ testit 1 verify-sig_verify_unsigned_checksums checksums.txt "${format}" "empty fail"
+}
+
+einfo "Testing coreutils format."
+eindent
+
+cat > checksums.txt <<-EOF || die
+ # some junk to test junk protection
+ b47cc0f104b62d4c7c30bcd68fd8e67613e287dc4ad8c310ef10cbadea9c4380 empty junk line
+ b47cc0f104b62d4c7c30bcd68gd8e67613e287dc4ad8c310ef10cbadea9c4380 empty
+
+ # sha1sums
+ da39a3ee5e6b4b0d3255bfef95601890afd80709 empty
+ 9c04cd6372077e9b11f70ca111c9807dc7137e4b text
+ 9c04cd6372077e9b11f70ca111c9807dc7137e4b fail
+
+ # sha256sums
+ e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 empty
+ b47cc0f104b62d4c7c30bcd68fd8e67613e287dc4ad8c310ef10cbadea9c4380 text
+ b47cc0f104b62d4c7c30bcd68fd8e67613e287dc4ad8c310ef10cbadea9c4380 fail
+
+ # sha512sums
+ cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e empty
+ 020da0f4d8a4c8bfbc98274027740061d7df52ee07091ed6595a083e0f45327bbe59424312d86f218b74ed2e25507abaf5c7a5fcf4cafcf9538b705808fd55ec text
+ 020da0f4d8a4c8bfbc98274027740061d7df52ee07091ed6595a083e0f45327bbe59424312d86f218b74ed2e25507abaf5c7a5fcf4cafcf9538b705808fd55ec fail
+EOF
+
+test_verify_unsigned_checksums sha256
+eoutdent
+
+texit
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2023-11-03 19:00 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2023-11-03 19:00 UTC (permalink / raw
To: gentoo-commits
commit: 0743271002be88d53b37fa48da0de291be2fdfe1
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 3 18:59:40 2023 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Nov 3 18:59:40 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=07432710
eclass/tests: Remove obsolete/broken distutils-r1 tests
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/distutils-r1.sh | 142 ------------------------------------
eclass/tests/distutils-r1_single.sh | 122 -------------------------------
2 files changed, 264 deletions(-)
diff --git a/eclass/tests/distutils-r1.sh b/eclass/tests/distutils-r1.sh
deleted file mode 100755
index c895af3fc9a0..000000000000
--- a/eclass/tests/distutils-r1.sh
+++ /dev/null
@@ -1,142 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-PYTHON_COMPAT=( python3_8 )
-source tests-common.sh || exit
-
-test-phase_name_free() {
- local ph=${1}
-
- if declare -f "${ph}"; then
- die "${ph} function declared while name reserved for phase!"
- fi
- if declare -f "${ph}_all"; then
- die "${ph}_all function declared while name reserved for phase!"
- fi
-}
-
-test-distutils_enable_tests() {
- local runner=${1}
- local exp_IUSE=${2}
- local exp_RESTRICT=${3}
- local exp_BDEPEND=${4}
-
- local IUSE=${IUSE}
- local RESTRICT=${RESTRICT}
- local BDEPEND=${BDEPEND}
-
- tbegin "${runner}"
-
- distutils_enable_tests "${runner}"
-
- local ret var val
- for var in IUSE RESTRICT BDEPEND; do
- local exp_var=exp_${var}
- # (this normalizes whitespace)
- read -d $'\0' -r -a val <<<"${!var}"
- val=${val[*]}
- if [[ ${val} != "${!exp_var}" ]]; then
- eindent
- eerror "${var} expected: ${!exp_var}"
- eerror "${var} actual: ${val}"
- eoutdent
- ret=1
- tret=1
- fi
- done
-
- tend ${ret}
-}
-
-test-DISTUTILS_USE_SETUPTOOLS() {
- local DISTUTILS_USE_SETUPTOOLS=${1}
- local exp_BDEPEND=${2}
- local exp_RDEPEND=${3}
-
- tbegin "${1}"
-
- local BDEPEND=
- local RDEPEND=
- unset _DISTUTILS_R1_ECLASS
- inherit distutils-r1
-
- local ret var val
- for var in BDEPEND RDEPEND; do
- local exp_var=exp_${var}
- # (this normalizes whitespace)
- read -d $'\0' -r -a val <<<"${!var}"
- val=${val[*]}
- if [[ ${val} != "${!exp_var}" ]]; then
- eindent
- eerror "${var} expected: ${!exp_var}"
- eerror "${var} actual: ${val}"
- eoutdent
- ret=1
- tret=1
- fi
- done
-
- tend ${ret}
-}
-
-DISTUTILS_USE_SETUPTOOLS=no
-inherit distutils-r1
-
-tbegin "sane function names"
-
-test-phase_name_free python_prepare
-test-phase_name_free python_configure
-test-phase_name_free python_compile
-test-phase_name_free python_test
-test-phase_name_free python_install
-
-tend
-
-einfo distutils_enable_tests
-eindent
-BASE_IUSE="python_targets_python3_8"
-BASE_DEPS="python_targets_python3_8? ( >=dev-lang/python-3.8.12_p1-r1:3.8 )"
-TEST_RESTRICT="!test? ( test )"
-
-einfo "empty RDEPEND"
-eindent
-RDEPEND=""
-test-distutils_enable_tests pytest \
- "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( >=dev-python/pytest-4.5.0[${PYTHON_USEDEP}] )"
-test-distutils_enable_tests nose \
- "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( >=dev-python/nose-1.3.7-r4[${PYTHON_USEDEP}] )"
-test-distutils_enable_tests unittest \
- "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( dev-python/unittest-or-fail[${PYTHON_USEDEP}] )"
-test-distutils_enable_tests setup.py \
- "${BASE_IUSE}" "" "${BASE_DEPS}"
-eoutdent
-
-einfo "non-empty RDEPEND"
-eindent
-BASE_RDEPEND="dev-python/foo[${PYTHON_USEDEP}]"
-RDEPEND=${BASE_RDEPEND}
-test-distutils_enable_tests pytest \
- "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} >=dev-python/pytest-4.5.0[${PYTHON_USEDEP}] )"
-test-distutils_enable_tests nose \
- "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} >=dev-python/nose-1.3.7-r4[${PYTHON_USEDEP}] )"
-test-distutils_enable_tests unittest \
- "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} dev-python/unittest-or-fail[${PYTHON_USEDEP}] )"
-test-distutils_enable_tests setup.py \
- "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} )"
-eoutdent
-
-eoutdent
-
-einfo DISTUTILS_USE_SETUPTOOLS
-eindent
-SETUPTOOLS_DEP=">=dev-python/setuptools-42.0.2[python_targets_python3_8(-)?]"
-test-DISTUTILS_USE_SETUPTOOLS no "${BASE_DEPS}" "${BASE_DEPS}"
-test-DISTUTILS_USE_SETUPTOOLS bdepend "${BASE_DEPS} ${SETUPTOOLS_DEP}" "${BASE_DEPS}"
-test-DISTUTILS_USE_SETUPTOOLS rdepend "${BASE_DEPS} ${SETUPTOOLS_DEP}" "${BASE_DEPS} ${SETUPTOOLS_DEP}"
-test-DISTUTILS_USE_SETUPTOOLS pyproject.toml "${BASE_DEPS} >=dev-python/pyproject2setuppy-22[python_targets_python3_8(-)?]" "${BASE_DEPS}"
-test-DISTUTILS_USE_SETUPTOOLS manual "${BASE_DEPS}" "${BASE_DEPS}"
-eoutdent
-
-texit
diff --git a/eclass/tests/distutils-r1_single.sh b/eclass/tests/distutils-r1_single.sh
deleted file mode 100755
index 2035f1454c60..000000000000
--- a/eclass/tests/distutils-r1_single.sh
+++ /dev/null
@@ -1,122 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-PYTHON_COMPAT=( python3_8 )
-source tests-common.sh || exit
-
-test-distutils_enable_tests() {
- local runner=${1}
- local exp_IUSE=${2}
- local exp_RESTRICT=${3}
- local exp_BDEPEND=${4}
-
- local IUSE=${IUSE}
- local RESTRICT=${RESTRICT}
- local BDEPEND=${BDEPEND}
-
- tbegin "${runner}"
-
- distutils_enable_tests "${runner}"
-
- local ret var
- for var in IUSE RESTRICT BDEPEND; do
- local exp_var=exp_${var}
- # (this normalizes whitespace)
- read -d $'\0' -r -a val <<<"${!var}"
- val=${val[*]}
- if [[ ${val} != "${!exp_var}" ]]; then
- eindent
- eerror "${var} expected: ${!exp_var}"
- eerror "${var} actual: ${val}"
- eoutdent
- ret=1
- tret=1
- fi
- done
-
- tend ${ret}
-}
-
-test-DISTUTILS_USE_SETUPTOOLS() {
- local DISTUTILS_USE_SETUPTOOLS=${1}
- local exp_BDEPEND=${2}
- local exp_RDEPEND=${3}
-
- tbegin "${1}"
-
- local BDEPEND=
- local RDEPEND=
- unset _DISTUTILS_R1_ECLASS
- inherit distutils-r1
-
- local ret var val
- for var in BDEPEND RDEPEND; do
- local exp_var=exp_${var}
- # (this normalizes whitespace)
- read -d $'\0' -r -a val <<<"${!var}"
- val=${val[*]}
- if [[ ${val} != "${!exp_var}" ]]; then
- eindent
- eerror "${var} expected: ${!exp_var}"
- eerror "${var} actual: ${val}"
- eoutdent
- ret=1
- tret=1
- fi
- done
-
- tend ${ret}
-}
-
-DISTUTILS_USE_SETUPTOOLS=no
-DISTUTILS_SINGLE_IMPL=1
-inherit distutils-r1
-
-einfo distutils_enable_tests
-eindent
-BASE_IUSE="+python_single_target_python3_8"
-BASE_DEPS="python_single_target_python3_8? ( >=dev-lang/python-3.8.12_p1-r1:3.8 )"
-TEST_RESTRICT="!test? ( test )"
-
-einfo "empty RDEPEND"
-eindent
-RDEPEND=""
-test-distutils_enable_tests pytest \
- "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( python_single_target_python3_8? ( >=dev-python/pytest-4.5.0[python_targets_python3_8(-)] ) )"
-test-distutils_enable_tests nose \
- "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( python_single_target_python3_8? ( >=dev-python/nose-1.3.7-r4[python_targets_python3_8(-)] ) )"
-test-distutils_enable_tests unittest \
- "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( python_single_target_python3_8? ( dev-python/unittest-or-fail[python_targets_python3_8(-)] ) )"
-test-distutils_enable_tests setup.py \
- "${BASE_IUSE}" "" "${BASE_DEPS}"
-eoutdent
-
-einfo "non-empty RDEPEND"
-eindent
-BASE_RDEPEND="dev-python/foo[${PYTHON_SINGLE_USEDEP}]"
-RDEPEND=${BASE_RDEPEND}
-test-distutils_enable_tests pytest \
- "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} python_single_target_python3_8? ( >=dev-python/pytest-4.5.0[python_targets_python3_8(-)] ) )"
-test-distutils_enable_tests nose \
- "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} python_single_target_python3_8? ( >=dev-python/nose-1.3.7-r4[python_targets_python3_8(-)] ) )"
-test-distutils_enable_tests unittest \
- "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} python_single_target_python3_8? ( dev-python/unittest-or-fail[python_targets_python3_8(-)] ) )"
-test-distutils_enable_tests setup.py \
- "${BASE_IUSE} test" "${TEST_RESTRICT}" "${BASE_DEPS} test? ( ${BASE_RDEPEND} )"
-eoutdent
-
-eoutdent
-
-einfo DISTUTILS_USE_SETUPTOOLS
-eindent
-SETUPTOOLS_DEP="python_single_target_python3_8? ( >=dev-python/setuptools-42.0.2[python_targets_python3_8(-)] )"
-test-DISTUTILS_USE_SETUPTOOLS no "${BASE_DEPS}" "${BASE_DEPS}"
-test-DISTUTILS_USE_SETUPTOOLS bdepend "${BASE_DEPS} ${SETUPTOOLS_DEP}" "${BASE_DEPS}"
-test-DISTUTILS_USE_SETUPTOOLS rdepend "${BASE_DEPS} ${SETUPTOOLS_DEP}" "${BASE_DEPS} ${SETUPTOOLS_DEP}"
-test-DISTUTILS_USE_SETUPTOOLS pyproject.toml "${BASE_DEPS} python_single_target_python3_8? ( >=dev-python/pyproject2setuppy-22[python_targets_python3_8(-)] )" "${BASE_DEPS}"
-test-DISTUTILS_USE_SETUPTOOLS manual "${BASE_DEPS}" "${BASE_DEPS}"
-eoutdent
-
-texit
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2024-05-25 8:24 Ulrich Müller
0 siblings, 0 replies; 94+ messages in thread
From: Ulrich Müller @ 2024-05-25 8:24 UTC (permalink / raw
To: gentoo-commits
commit: 16b2c5ebb2869f4132536e5eb0a465b534556fb6
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Thu May 9 10:45:26 2024 +0000
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sat May 25 08:22:48 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=16b2c5eb
eclass/tests: Copy code from eapi7-ver.eclass to version-functions.sh
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 <AT> gentoo.org>
eclass/tests/dist-kernel-utils.sh | 6 +-
eclass/tests/eapi7-ver.sh | 7 +-
eclass/tests/eapi7-ver_benchmark.sh | 147 ------------------
eclass/tests/toolchain.sh | 4 +-
eclass/tests/version-funcs.sh | 302 ++++++++++++++++++++++++++++++++++++
5 files changed, 309 insertions(+), 157 deletions(-)
diff --git a/eclass/tests/dist-kernel-utils.sh b/eclass/tests/dist-kernel-utils.sh
index 7f04f55ce302..50ba001f8e9c 100755
--- a/eclass/tests/dist-kernel-utils.sh
+++ b/eclass/tests/dist-kernel-utils.sh
@@ -1,14 +1,14 @@
#!/usr/bin/env bash
-# Copyright 2022 Gentoo Authors
+# Copyright 2022-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
source tests-common.sh || exit
+# TODO: hack because tests-common don't implement ver_cut
+source version-funcs.sh || exit
inherit dist-kernel-utils
-# TODO: hack because tests-common don't implement ver_cut
-EAPI=6 inherit eapi7-ver
test_PV_to_KV() {
local kv=${1}
diff --git a/eclass/tests/eapi7-ver.sh b/eclass/tests/eapi7-ver.sh
index 13cd671e7158..ee7e6d728ef7 100755
--- a/eclass/tests/eapi7-ver.sh
+++ b/eclass/tests/eapi7-ver.sh
@@ -1,12 +1,9 @@
#!/bin/bash
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=6
-
source tests-common.sh || exit
-
-inherit eapi7-ver
+source version-funcs.sh || exit
teq() {
local expected=${1}; shift
diff --git a/eclass/tests/eapi7-ver_benchmark.sh b/eclass/tests/eapi7-ver_benchmark.sh
deleted file mode 100755
index ab324edb95c9..000000000000
--- a/eclass/tests/eapi7-ver_benchmark.sh
+++ /dev/null
@@ -1,147 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-source tests-common.sh || exit
-
-inherit eapi7-ver versionator
-
-cutting() {
- local x
- for x in {1..1000}; do
- ver_cut 1 1.2.3
- ver_cut 1-2 1.2.3
- ver_cut 2- 1.2.3
- ver_cut 1- 1.2.3
- ver_cut 3-4 1.2.3b_alpha4
- ver_cut 5 1.2.3b_alpha4
- ver_cut 1-2 .1.2.3
- ver_cut 0-2 .1.2.3
- ver_cut 2-3 1.2.3.
- ver_cut 2- 1.2.3.
- ver_cut 2-4 1.2.3.
- done >/dev/null
-}
-
-cutting_versionator() {
- local x
- for x in {1..100}; do
- get_version_component_range 1 1.2.3
- get_version_component_range 1-2 1.2.3
- get_version_component_range 2- 1.2.3
- get_version_component_range 1- 1.2.3
- get_version_component_range 3-4 1.2.3b_alpha4
- get_version_component_range 5 1.2.3b_alpha4
- get_version_component_range 1-2 .1.2.3
- get_version_component_range 0-2 .1.2.3
- get_version_component_range 2-3 1.2.3.
- get_version_component_range 2- 1.2.3.
- get_version_component_range 2-4 1.2.3.
- done >/dev/null
-}
-
-replacing() {
- local x
- for x in {1..1000}; do
- ver_rs 1 - 1.2.3
- ver_rs 2 - 1.2.3
- ver_rs 1-2 - 1.2.3.4
- ver_rs 2- - 1.2.3.4
- ver_rs 2 . 1.2-3
- ver_rs 3 . 1.2.3a
- ver_rs 2-3 - 1.2_alpha4
- #ver_rs 3 - 2 "" 1.2.3b_alpha4
- #ver_rs 3-5 _ 4-6 - a1b2c3d4e5
- ver_rs 1 - .1.2.3
- ver_rs 0 - .1.2.3
- done >/dev/null
-}
-
-replacing_versionator() {
- local x
- for x in {1..100}; do
- replace_version_separator 1 - 1.2.3
- replace_version_separator 2 - 1.2.3
- replace_version_separator 1-2 - 1.2.3.4
- replace_version_separator 2- - 1.2.3.4
- replace_version_separator 2 . 1.2-3
- replace_version_separator 3 . 1.2.3a
- replace_version_separator 2-3 - 1.2_alpha4
- #replace_version_separator 3 - 2 "" 1.2.3b_alpha4
- #replace_version_separator 3-5 _ 4-6 - a1b2c3d4e5
- replace_version_separator 1 - .1.2.3
- replace_version_separator 0 - .1.2.3
- done >/dev/null
-}
-
-comparing() {
- local x
- for x in {1..1000}; do
- ver_test 1b_p1 -le 1_p1
- ver_test 1.1b -le 1.1
- ver_test 12.2.5 -le 12.2b
- ver_test 4.0 -le 5.0
- ver_test 5 -le 5.0
- ver_test 1.0_pre2 -le 1.0_p2
- ver_test 1.0_alpha2 -le 1.0_p2
- ver_test 1.0_alpha1 -le 1.0_beta1
- ver_test 1.0_beta3 -le 1.0_rc3
- ver_test 1.001000000000000001 -le 1.001000000000000002
- done
-}
-
-comparing_versionator() {
- local x
- for x in {1..100}; do
- version_is_at_least 1b_p1 1_p1
- version_is_at_least 1.1b 1.1
- version_is_at_least 12.2.5 12.2b
- version_is_at_least 4.0 5.0
- version_is_at_least 5 5.0
- version_is_at_least 1.0_pre2 1.0_p2
- version_is_at_least 1.0_alpha2 1.0_p2
- version_is_at_least 1.0_alpha1 1.0_beta1
- version_is_at_least 1.0_beta3 1.0_rc3
- version_is_at_least 1.001000000000000001 1.001000000000000002
- done
-}
-
-get_times() {
- local factor=${1}; shift
- echo "${*}"
- local real=()
- local user=()
-
- for x in {1..5}; do
- while read tt tv; do
- case ${tt} in
- real) real+=( $(dc -e "${tv} ${factor} * p") );;
- user) user+=( $(dc -e "${tv} ${factor} * p") );;
- esac
- done < <( ( time -p "${@}" ) 2>&1 )
- done
-
- [[ ${#real[@]} == 5 ]] || die "Did not get 5 real times"
- [[ ${#user[@]} == 5 ]] || die "Did not get 5 user times"
-
- local sum
- for v in real user; do
- vr="${v}[*]"
- sum=$(dc -e "${!vr} + + + + 3 k 5 / p")
-
- vr="${v}[@]"
- printf '%s %4.2f %4.2f %4.2f %4.2f %4.2f => %4.2f avg\n' \
- "${v}" "${!vr}" "${sum}"
- done
-}
-
-export LC_ALL=C
-
-get_times 1 cutting
-get_times 10 cutting_versionator
-get_times 1 replacing
-get_times 10 replacing_versionator
-get_times 1 comparing
-get_times 10 comparing_versionator
diff --git a/eclass/tests/toolchain.sh b/eclass/tests/toolchain.sh
index 1f21e7d842b1..6f8df5b4fc4a 100755
--- a/eclass/tests/toolchain.sh
+++ b/eclass/tests/toolchain.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -9,8 +9,8 @@ TOOLCHAIN_GCC_PV=11.3.0
PR=r0
source tests-common.sh || exit
+source version-funcs.sh || exit
-EAPI=6 inherit eapi7-ver
EAPI=7 inherit toolchain
# Ignore actually running version of gcc and fake new version
diff --git a/eclass/tests/version-funcs.sh b/eclass/tests/version-funcs.sh
new file mode 100644
index 000000000000..6e83c01666f0
--- /dev/null
+++ b/eclass/tests/version-funcs.sh
@@ -0,0 +1,302 @@
+#!/bin/bash
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: eapi7-ver.eclass
+# @MAINTAINER:
+# PMS team <pms@gentoo.org>
+# @AUTHOR:
+# Ulrich Müller <ulm@gentoo.org>
+# Michał Górny <mgorny@gentoo.org>
+# @BLURB: Testing implementation of EAPI 7 version manipulators
+# @DESCRIPTION:
+# A stand-alone implementation of the version manipulation functions
+# aimed for EAPI 7. Intended to be used for wider testing of
+# the proposed functions and to allow ebuilds to switch to the new
+# model early, with minimal change needed for actual EAPI 7.
+#
+# https://bugs.gentoo.org/482170
+#
+# @SUBSECTION Version strings
+#
+# The functions support arbitrary version strings consisting of version
+# components interspersed with (possibly empty) version separators.
+#
+# A version component can either consist purely of digits ([0-9]+)
+# or purely of uppercase and lowercase letters ([A-Za-z]+). A version
+# separator is either a string of any other characters ([^A-Za-z0-9]+),
+# or it occurs at the transition between a sequence of letters
+# and a sequence of digits, or vice versa. In the latter case,
+# the version separator is an empty string.
+#
+# The version is processed left-to-right, and each successive component
+# is assigned numbers starting with 1. The components are either split
+# on version separators or on boundaries between digits and letters
+# (in which case the separator between the components is empty).
+# Version separators are assigned numbers starting with 1 for
+# the separator between 1st and 2nd components. As a special case,
+# if the version string starts with a separator, it is assigned index 0.
+#
+# Examples:
+#
+# @CODE
+# 1.2b-alpha4 -> 1 . 2 '' b - alpha '' 4
+# c s c s c s c s c
+# 1 1 2 2 3 3 4 4 5
+#
+# .11. -> . 11 .
+# s c s
+# 0 1 1
+# @CODE
+#
+# @SUBSECTION Ranges
+#
+# A range can be specified as 'm' for m-th version component, 'm-'
+# for all components starting with m-th or 'm-n' for components starting
+# at m-th and ending at n-th (inclusive). If the range spans outside
+# the version string, it is truncated silently.
+
+# @FUNCTION: _ver_parse_range
+# @USAGE: <range> <max>
+# @INTERNAL
+# @DESCRIPTION:
+# Parse the range string <range>, setting 'start' and 'end' variables
+# to the appropriate bounds. <max> specifies the appropriate upper
+# bound for the range; the user-specified value is truncated to this.
+_ver_parse_range() {
+ local range=${1}
+ local max=${2}
+
+ [[ ${range} == [0-9]* ]] \
+ || die "${FUNCNAME}: range must start with a number"
+ start=${range%-*}
+ [[ ${range} == *-* ]] && end=${range#*-} || end=${start}
+ if [[ ${end} ]]; then
+ [[ ${start} -le ${end} ]] \
+ || die "${FUNCNAME}: end of range must be >= start"
+ [[ ${end} -le ${max} ]] || end=${max}
+ else
+ end=${max}
+ fi
+}
+
+# @FUNCTION: _ver_split
+# @USAGE: <version>
+# @INTERNAL
+# @DESCRIPTION:
+# Split the version string <version> into separator-component array.
+# Sets 'comp' to an array of the form: ( s_0 c_1 s_1 c_2 s_2 c_3... )
+# where s_i are separators and c_i are components.
+_ver_split() {
+ local v=${1} LC_ALL=C
+
+ comp=()
+
+ # get separators and components
+ local s c
+ while [[ ${v} ]]; do
+ # cut the separator
+ s=${v%%[a-zA-Z0-9]*}
+ v=${v:${#s}}
+ # cut the next component; it can be either digits or letters
+ [[ ${v} == [0-9]* ]] && c=${v%%[^0-9]*} || c=${v%%[^a-zA-Z]*}
+ v=${v:${#c}}
+
+ comp+=( "${s}" "${c}" )
+ done
+}
+
+# @FUNCTION: ver_cut
+# @USAGE: <range> [<version>]
+# @DESCRIPTION:
+# Print the substring of the version string containing components
+# defined by the <range> and the version separators between them.
+# Processes <version> if specified, ${PV} otherwise.
+#
+# For the syntax of versions and ranges, please see the eclass
+# description.
+ver_cut() {
+ local range=${1}
+ local v=${2:-${PV}}
+ local start end
+ local -a comp
+
+ _ver_split "${v}"
+ local max=$((${#comp[@]}/2))
+ _ver_parse_range "${range}" "${max}"
+
+ if [[ ${start} -gt 0 ]]; then
+ start=$(( start*2 - 1 ))
+ fi
+ # Work around a bug in bash-3.2, where "${comp[*]:start:end*2-start}"
+ # inserts stray 0x7f characters for empty array elements
+ printf "%s" "${comp[@]:start:end*2-start}" $'\n'
+}
+
+# @FUNCTION: ver_rs
+# @USAGE: <range> <repl> [<range> <repl>...] [<version>]
+# @DESCRIPTION:
+# Print the version string after substituting the specified version
+# separators at <range> with <repl> (string). Multiple '<range> <repl>'
+# pairs can be specified. Processes <version> if specified,
+# ${PV} otherwise.
+#
+# For the syntax of versions and ranges, please see the eclass
+# description.
+ver_rs() {
+ local v
+ (( ${#} & 1 )) && v=${@: -1} || v=${PV}
+ local start end i
+ local -a comp
+
+ _ver_split "${v}"
+ local max=$((${#comp[@]}/2 - 1))
+
+ while [[ ${#} -ge 2 ]]; do
+ _ver_parse_range "${1}" "${max}"
+ for (( i = start*2; i <= end*2; i+=2 )); do
+ [[ ${i} -eq 0 && -z ${comp[i]} ]] && continue
+ comp[i]=${2}
+ done
+ shift 2
+ done
+
+ local IFS=
+ echo "${comp[*]}"
+}
+
+# @FUNCTION: _ver_compare_int
+# @USAGE: <a> <b>
+# @RETURN: 0 if <a> -eq <b>, 1 if <a> -lt <b>, 3 if <a> -gt <b>
+# @INTERNAL
+# @DESCRIPTION:
+# Compare two non-negative integers <a> and <b>, of arbitrary length.
+# If <a> is equal to, less than, or greater than <b>, return 0, 1, or 3
+# as exit status, respectively.
+_ver_compare_int() {
+ local a=$1 b=$2 d=$(( ${#1}-${#2} ))
+
+ # Zero-pad to equal length if necessary.
+ if [[ ${d} -gt 0 ]]; then
+ printf -v b "%0${d}d%s" 0 "${b}"
+ elif [[ ${d} -lt 0 ]]; then
+ printf -v a "%0$(( -d ))d%s" 0 "${a}"
+ fi
+
+ [[ ${a} > ${b} ]] && return 3
+ [[ ${a} == "${b}" ]]
+}
+
+# @FUNCTION: _ver_compare
+# @USAGE: <va> <vb>
+# @RETURN: 1 if <va> < <vb>, 2 if <va> = <vb>, 3 if <va> > <vb>
+# @INTERNAL
+# @DESCRIPTION:
+# Compare two versions <va> and <vb>. If <va> is less than, equal to,
+# or greater than <vb>, return 1, 2, or 3 as exit status, respectively.
+_ver_compare() {
+ local va=${1} vb=${2} a an al as ar b bn bl bs br re LC_ALL=C
+
+ re="^([0-9]+(\.[0-9]+)*)([a-z]?)((_(alpha|beta|pre|rc|p)[0-9]*)*)(-r[0-9]+)?$"
+
+ [[ ${va} =~ ${re} ]] || die "${FUNCNAME}: invalid version: ${va}"
+ an=${BASH_REMATCH[1]}
+ al=${BASH_REMATCH[3]}
+ as=${BASH_REMATCH[4]}
+ ar=${BASH_REMATCH[7]}
+
+ [[ ${vb} =~ ${re} ]] || die "${FUNCNAME}: invalid version: ${vb}"
+ bn=${BASH_REMATCH[1]}
+ bl=${BASH_REMATCH[3]}
+ bs=${BASH_REMATCH[4]}
+ br=${BASH_REMATCH[7]}
+
+ # Compare numeric components (PMS algorithm 3.2)
+ # First component
+ _ver_compare_int "${an%%.*}" "${bn%%.*}" || return
+
+ while [[ ${an} == *.* && ${bn} == *.* ]]; do
+ # Other components (PMS algorithm 3.3)
+ an=${an#*.}
+ bn=${bn#*.}
+ a=${an%%.*}
+ b=${bn%%.*}
+ if [[ ${a} == 0* || ${b} == 0* ]]; then
+ # Remove any trailing zeros
+ [[ ${a} =~ 0+$ ]] && a=${a%"${BASH_REMATCH[0]}"}
+ [[ ${b} =~ 0+$ ]] && b=${b%"${BASH_REMATCH[0]}"}
+ [[ ${a} > ${b} ]] && return 3
+ [[ ${a} < ${b} ]] && return 1
+ else
+ _ver_compare_int "${a}" "${b}" || return
+ fi
+ done
+ [[ ${an} == *.* ]] && return 3
+ [[ ${bn} == *.* ]] && return 1
+
+ # Compare letter components (PMS algorithm 3.4)
+ [[ ${al} > ${bl} ]] && return 3
+ [[ ${al} < ${bl} ]] && return 1
+
+ # Compare suffixes (PMS algorithm 3.5)
+ as=${as#_}${as:+_}
+ bs=${bs#_}${bs:+_}
+ while [[ -n ${as} && -n ${bs} ]]; do
+ # Compare each suffix (PMS algorithm 3.6)
+ a=${as%%_*}
+ b=${bs%%_*}
+ if [[ ${a%%[0-9]*} == "${b%%[0-9]*}" ]]; then
+ _ver_compare_int "${a##*[a-z]}" "${b##*[a-z]}" || return
+ else
+ # Check for p first
+ [[ ${a%%[0-9]*} == p ]] && return 3
+ [[ ${b%%[0-9]*} == p ]] && return 1
+ # Hack: Use that alpha < beta < pre < rc alphabetically
+ [[ ${a} > ${b} ]] && return 3 || return 1
+ fi
+ as=${as#*_}
+ bs=${bs#*_}
+ done
+ if [[ -n ${as} ]]; then
+ [[ ${as} == p[_0-9]* ]] && return 3 || return 1
+ elif [[ -n ${bs} ]]; then
+ [[ ${bs} == p[_0-9]* ]] && return 1 || return 3
+ fi
+
+ # Compare revision components (PMS algorithm 3.7)
+ _ver_compare_int "${ar#-r}" "${br#-r}" || return
+
+ return 2
+}
+
+# @FUNCTION: ver_test
+# @USAGE: [<v1>] <op> <v2>
+# @DESCRIPTION:
+# Check if the relation <v1> <op> <v2> is true. If <v1> is not specified,
+# default to ${PVR}. <op> can be -gt, -ge, -eq, -ne, -le, -lt.
+# Both versions must conform to the PMS version syntax (with optional
+# revision parts), and the comparison is performed according to
+# the algorithm specified in the PMS.
+ver_test() {
+ local va op vb
+
+ if [[ $# -eq 3 ]]; then
+ va=${1}
+ shift
+ else
+ va=${PVR}
+ fi
+
+ [[ $# -eq 2 ]] || die "${FUNCNAME}: bad number of arguments"
+
+ op=${1}
+ vb=${2}
+
+ case ${op} in
+ -eq|-ne|-lt|-le|-gt|-ge) ;;
+ *) die "${FUNCNAME}: invalid operator: ${op}" ;;
+ esac
+
+ _ver_compare "${va}" "${vb}"
+ test $? "${op}" 2
+}
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2024-06-12 9:47 Ulrich Müller
0 siblings, 0 replies; 94+ messages in thread
From: Ulrich Müller @ 2024-06-12 9:47 UTC (permalink / raw
To: gentoo-commits
commit: 8629d5a9fc153679289b85189f385af8348f4f25
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 12 09:43:49 2024 +0000
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Wed Jun 12 09:46:39 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8629d5a9
eclass/tests: Override use() in linux-info_get_running_version.sh
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 <AT> gentoo.org>
eclass/tests/linux-info_get_running_version.sh | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/eclass/tests/linux-info_get_running_version.sh b/eclass/tests/linux-info_get_running_version.sh
index 57aaf2fedcd4..b8ae8c4b85ae 100755
--- a/eclass/tests/linux-info_get_running_version.sh
+++ b/eclass/tests/linux-info_get_running_version.sh
@@ -1,12 +1,20 @@
#!/bin/bash
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=6
+EAPI=8
source tests-common.sh || exit
+source version-funcs.sh || exit
inherit linux-info
+use() {
+ case $1 in
+ kernel_linux) return 0 ;;
+ esac
+ die "${FUNCNAME[0]}: unknown flag"
+}
+
test_get_running_version() {
local test_kv=$1 major=$2 minor=$3 patch=$4 extra=$5
tbegin "get_running_version ${test_kv}"
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2024-06-12 15:32 Ulrich Müller
0 siblings, 0 replies; 94+ messages in thread
From: Ulrich Müller @ 2024-06-12 15:32 UTC (permalink / raw
To: gentoo-commits
commit: dfbc5ab206ba0da4c5fcab2559bb662fb46084a1
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 12 15:28:23 2024 +0000
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Wed Jun 12 15:31:47 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dfbc5ab2
eclass/tests: Make *-bench.sh work with reference dc
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 <AT> gentoo.org>
eclass/tests/cargo-bench.sh | 4 ++--
eclass/tests/pypi-bench.sh | 4 ++--
eclass/tests/python-utils-bench.sh | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/eclass/tests/cargo-bench.sh b/eclass/tests/cargo-bench.sh
index d30b04569905..9347fe339c12 100755
--- a/eclass/tests/cargo-bench.sh
+++ b/eclass/tests/cargo-bench.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 2023 Gentoo Authors
+# Copyright 2023-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -39,7 +39,7 @@ timeit() {
local xr avg
for x in real user; do
xr="${x}[*]"
- avg=$(dc -S 3 -e "${ITERATIONS} ${RUNS} * ${!xr} + + / p")
+ avg=$(dc -e "3 k ${ITERATIONS} ${RUNS} * ${!xr} + + / p")
printf '%s %4.0f it/s\n' "${x}" "${avg}"
done
diff --git a/eclass/tests/pypi-bench.sh b/eclass/tests/pypi-bench.sh
index cce93527b729..02855563db3f 100755
--- a/eclass/tests/pypi-bench.sh
+++ b/eclass/tests/pypi-bench.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 2023 Gentoo Authors
+# Copyright 2023-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -39,7 +39,7 @@ timeit() {
local xr avg
for x in real user; do
xr="${x}[*]"
- avg=$(dc -S 3 -e "${ITERATIONS} ${RUNS} * ${!xr} + + / p")
+ avg=$(dc -e "3 k ${ITERATIONS} ${RUNS} * ${!xr} + + / p")
printf '%s %4.0f it/s\n' "${x}" "${avg}"
done
diff --git a/eclass/tests/python-utils-bench.sh b/eclass/tests/python-utils-bench.sh
index 7f27adef5509..f718b9f125cb 100755
--- a/eclass/tests/python-utils-bench.sh
+++ b/eclass/tests/python-utils-bench.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 2023 Gentoo Authors
+# Copyright 2023-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -38,7 +38,7 @@ timeit() {
local xr avg
for x in real user; do
xr="${x}[*]"
- avg=$(dc -S 3 -e "${ITERATIONS} ${RUNS} * ${!xr} + + / p")
+ avg=$(dc -e "3 k ${ITERATIONS} ${RUNS} * ${!xr} + + / p")
printf '%s %4.0f it/s\n' "${x}" "${avg}"
done
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2024-06-12 15:35 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2024-06-12 15:35 UTC (permalink / raw
To: gentoo-commits
commit: 2a7763a875ff6f4a74b6c40c0238a50febcfafab
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 12 15:34:29 2024 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Jun 12 15:35:31 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2a7763a8
eclass/tests: Remove git-r3.sh
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 <AT> gentoo.org>
eclass/tests/git-r3.sh | 208 -------------------------------------------------
1 file changed, 208 deletions(-)
diff --git a/eclass/tests/git-r3.sh b/eclass/tests/git-r3.sh
deleted file mode 100755
index 02cbcbc59125..000000000000
--- a/eclass/tests/git-r3.sh
+++ /dev/null
@@ -1,208 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-# git no longer allows ext: protocol, meh
-exit 0
-
-EAPI=7
-
-source tests-common.sh || exit
-
-inherit git-r3
-
-testdir=${pkg_root}/git
-mkdir "${testdir}" || die "unable to mkdir testdir"
-cd "${testdir}" || die "unable to cd to testdir"
-
-EGIT3_STORE_DIR=store
-mkdir "${EGIT3_STORE_DIR}" || die "unable to mkdir store"
-
-test_file() {
- local fn=${1}
- local expect=${2}
-
- if [[ ! -f ${fn} ]]; then
- eerror "${fn} does not exist (not checked out?)"
- else
- local got=$(<"${fn}")
-
- if [[ ${got} != ${expect} ]]; then
- eerror "${fn}, expected: ${expect}, got: ${got}"
- else
- return 0
- fi
- fi
- return 1
-}
-
-test_no_file() {
- local fn=${1}
-
- if [[ -f ${fn} ]]; then
- eerror "${fn} exists (wtf?!)"
- else
- return 0
- fi
- return 1
-}
-
-test_repo_clean() {
- local P=${P}_${FUNCNAME#test_}
-
- (
- mkdir repo
- cd repo
- git init -q
- echo test > file
- git add file
- git commit -m 1 -q
- echo other-text > file2
- git add file2
- git commit -m 2 -q
- ) || die "unable to prepare repo"
-
- # we need to use an array to preserve whitespace
- local EGIT_REPO_URI=(
- "ext::git daemon --export-all --base-path=. --inetd %G/repo"
- )
-
- tbegin "fetching from a simple repo"
- (
- git-r3_src_unpack
- test_file "${WORKDIR}/${P}/file" test && \
- test_file "${WORKDIR}/${P}/file2" other-text
- ) &>fetch.log
-
- eend ${?} || cat fetch.log
-}
-
-test_repo_revert() {
- local P=${P}_${FUNCNAME#test_}
-
- (
- cd repo
- git revert -n HEAD^
- git commit -m r1 -q
- ) || die "unable to prepare repo"
-
- # we need to use an array to preserve whitespace
- local EGIT_REPO_URI=(
- "ext::git daemon --export-all --base-path=. --inetd %G/repo"
- )
-
- tbegin "fetching revert"
- (
- git-r3_src_unpack
- test_no_file "${WORKDIR}/${P}/file" && \
- test_file "${WORKDIR}/${P}/file2" other-text
- ) &>fetch.log
-
- eend ${?} || cat fetch.log
-}
-
-test_repo_branch() {
- local P=${P}_${FUNCNAME#test_}
-
- (
- cd repo
- git branch -q other-branch HEAD^
- git checkout -q other-branch
- echo one-more > file3
- git add file3
- git commit -m 3 -q
- git checkout -q master
- ) || die "unable to prepare repo"
-
- # we need to use an array to preserve whitespace
- local EGIT_REPO_URI=(
- "ext::git daemon --export-all --base-path=. --inetd %G/repo"
- )
- local EGIT_BRANCH=other-branch
-
- tbegin "switching branches"
- (
- git-r3_src_unpack
- test_file "${WORKDIR}/${P}/file" test && \
- test_file "${WORKDIR}/${P}/file2" other-text && \
- test_file "${WORKDIR}/${P}/file3" one-more
- ) &>fetch.log
-
- eend ${?} || cat fetch.log
-}
-
-test_repo_merge() {
- local P=${P}_${FUNCNAME#test_}
-
- (
- cd repo
- git branch -q one-more-branch HEAD^
- git checkout -q one-more-branch
- echo foobarbaz > file3
- git add file3
- git commit -m 3b -q
- git checkout -q master
- git merge -m 4 -q one-more-branch
- ) || die "unable to prepare repo"
-
- # we need to use an array to preserve whitespace
- local EGIT_REPO_URI=(
- "ext::git daemon --export-all --base-path=. --inetd %G/repo"
- )
-
- tbegin "fetching a merge commit"
- (
- git-r3_src_unpack
- test_no_file "${WORKDIR}/${P}/file" && \
- test_file "${WORKDIR}/${P}/file2" other-text && \
- test_file "${WORKDIR}/${P}/file3" foobarbaz
- ) &>fetch.log
-
- eend ${?} || cat fetch.log
-}
-
-test_repo_revert_merge() {
- local P=${P}_${FUNCNAME#test_}
-
- (
- cd repo
- git branch -q to-be-reverted
- git checkout -q to-be-reverted
- echo trrm > file3
- git add file3
- git commit -m 5b -q
- git checkout -q master
- echo trrm > file2
- git add file2
- git commit -m 5 -q
- git merge -m 6 -q to-be-reverted
- echo trrm > file
- git add file
- git commit -m 7 -q
- git revert -m 1 -n HEAD^
- git commit -m 7r -q
- ) || die "unable to prepare repo"
-
- # we need to use an array to preserve whitespace
- local EGIT_REPO_URI=(
- "ext::git daemon --export-all --base-path=. --inetd %G/repo"
- )
-
- tbegin "fetching a revert of a merge commit"
- (
- git-r3_src_unpack
- test_file "${WORKDIR}/${P}/file" trrm && \
- test_file "${WORKDIR}/${P}/file2" trrm && \
- test_file "${WORKDIR}/${P}/file3" foobarbaz
- ) &>fetch.log
-
- eend ${?} || cat fetch.log
-}
-
-test_repo_clean
-test_repo_revert
-test_repo_branch
-test_repo_merge
-test_repo_revert_merge
-
-texit
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2024-06-12 16:47 Ulrich Müller
0 siblings, 0 replies; 94+ messages in thread
From: Ulrich Müller @ 2024-06-12 16:47 UTC (permalink / raw
To: gentoo-commits
commit: 8c8239bdffa74b2c12ff9bbb5c25d62947e9a0a2
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 12 15:37:07 2024 +0000
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Wed Jun 12 16:47:34 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8c8239bd
eclass/tests: Drop FreeBSD test from toolchain-funcs.sh
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 <AT> gentoo.org>
eclass/tests/toolchain-funcs.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/eclass/tests/toolchain-funcs.sh b/eclass/tests/toolchain-funcs.sh
index 08cfd74611aa..ee10ddf50c1e 100755
--- a/eclass/tests/toolchain-funcs.sh
+++ b/eclass/tests/toolchain-funcs.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -28,7 +28,7 @@ test-tc-arch-kernel() {
tbegin "tc-arch-kernel() (KV=2.6.30)"
test-tc-arch-kernel 2.6.30 \
i{3..6}86:x86 x86_64:x86 \
- powerpc{,64}:powerpc i{3..6}86-gentoo-freebsd:i386 \
+ powerpc{,64}:powerpc \
or1k:openrisc or1k-linux-musl:openrisc
tend $?
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2024-06-13 18:35 Ulrich Müller
0 siblings, 0 replies; 94+ messages in thread
From: Ulrich Müller @ 2024-06-13 18:35 UTC (permalink / raw
To: gentoo-commits
commit: f68343bd1e545838952c2cb4c8338d31b223045e
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 13 18:32:12 2024 +0000
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Thu Jun 13 18:35:31 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f68343bd
eclass/tests: Update rebar_*.sh to EAPI 8
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
eclass/tests/rebar_fix_include_path.sh | 8 ++++++--
eclass/tests/rebar_remove_deps.sh | 4 ++--
eclass/tests/rebar_set_vsn.sh | 4 ++--
3 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/eclass/tests/rebar_fix_include_path.sh b/eclass/tests/rebar_fix_include_path.sh
index 339633e91e3a..46c5712104b1 100755
--- a/eclass/tests/rebar_fix_include_path.sh
+++ b/eclass/tests/rebar_fix_include_path.sh
@@ -1,16 +1,20 @@
#!/bin/bash
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
source tests-common.sh || exit
-EAPI=6
+EAPI=8
inherit rebar
EPREFIX="${tmpdir}/fakeroot"
S="${WORKDIR}/${P}"
+get_libdir() {
+ echo lib
+}
+
setup() {
mkdir -p "${S}" || die
diff --git a/eclass/tests/rebar_remove_deps.sh b/eclass/tests/rebar_remove_deps.sh
index b544a3078dbb..e2717b59eaf9 100755
--- a/eclass/tests/rebar_remove_deps.sh
+++ b/eclass/tests/rebar_remove_deps.sh
@@ -1,10 +1,10 @@
#!/bin/bash
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
source tests-common.sh || exit
-EAPI=6
+EAPI=8
inherit rebar
diff --git a/eclass/tests/rebar_set_vsn.sh b/eclass/tests/rebar_set_vsn.sh
index c828732b0079..6cc4600695a6 100755
--- a/eclass/tests/rebar_set_vsn.sh
+++ b/eclass/tests/rebar_set_vsn.sh
@@ -1,10 +1,10 @@
#!/bin/bash
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
source tests-common.sh || exit
-EAPI=6
+EAPI=8
inherit rebar
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2024-06-13 18:35 Ulrich Müller
0 siblings, 0 replies; 94+ messages in thread
From: Ulrich Müller @ 2024-06-13 18:35 UTC (permalink / raw
To: gentoo-commits
commit: ba67b6e7fd84fff922569627003bb3ae326c7f41
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 13 18:29:44 2024 +0000
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Thu Jun 13 18:35:30 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ba67b6e7
eclass/tests: Rename test function in savedconfig.sh
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 <AT> gentoo.org>
eclass/tests/savedconfig.sh | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/eclass/tests/savedconfig.sh b/eclass/tests/savedconfig.sh
index 16645fc05854..ad03ce2d2d94 100755
--- a/eclass/tests/savedconfig.sh
+++ b/eclass/tests/savedconfig.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -18,7 +18,13 @@ quiet() {
sc() { EBUILD_PHASE=install quiet save_config "$@" ; }
rc() { EBUILD_PHASE=prepare quiet restore_config "$@" ; }
-cleanup() { rm -rf "${ED}"/* "${T}"/* "${WORKDIR}"/* ; }
+cleanup() {
+ # make sure that these variables exist
+ [[ -n ${ED} && -n ${T} && -n ${WORKDIR} ]] \
+ || { die "${FUNCNAME[0]}: undefined variable"; exit 1; }
+ rm -rf "${ED}"/* "${T}"/* "${WORKDIR}"/*
+}
+
test-it() {
local ret=0
tbegin "$@"
@@ -26,7 +32,7 @@ test-it() {
: $(( ret |= $? ))
pushd "${WORKDIR}" >/dev/null
: $(( ret |= $? ))
- test
+ test_sc
: $(( ret |= $? ))
popd >/dev/null
: $(( ret |= $? ))
@@ -34,21 +40,21 @@ test-it() {
cleanup
}
-test() {
+test_sc() {
touch f || return 1
sc f || return 1
[[ -f ${ED}/etc/portage/savedconfig/${CATEGORY}/${PF} ]]
}
test-it "simple save_config"
-test() {
+test_sc() {
touch a b c || return 1
sc a b c || return 1
[[ -d ${ED}/etc/portage/savedconfig/${CATEGORY}/${PF} ]]
}
test-it "multi save_config"
-test() {
+test_sc() {
mkdir dir || return 1
touch dir/{a,b,c} || return 1
sc dir || return 1
@@ -58,14 +64,14 @@ test-it "dir save_config"
PORTAGE_CONFIGROOT=${D}
-test() {
+test_sc() {
echo "ggg" > f || return 1
rc f || return 1
[[ $(<f) == "ggg" ]]
}
test-it "simple restore_config"
-test() {
+test_sc() {
echo "ggg" > f || return 1
rc f || return 1
[[ $(<f) == "ggg" ]] || return 1
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2024-06-13 19:53 Ulrich Müller
0 siblings, 0 replies; 94+ messages in thread
From: Ulrich Müller @ 2024-06-13 19:53 UTC (permalink / raw
To: gentoo-commits
commit: 0fcc9d42818f61e8e094bae67740a656b6d16caa
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 13 19:39:31 2024 +0000
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Thu Jun 13 19:53:14 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0fcc9d42
eclass/tests: Filter version-funcs.sh from the list of tests
Fixes: 16b2c5ebb2869f4132536e5eb0a465b534556fb6
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
eclass/tests/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/eclass/tests/Makefile b/eclass/tests/Makefile
index ee4a454912c3..e5d1c3915fe1 100644
--- a/eclass/tests/Makefile
+++ b/eclass/tests/Makefile
@@ -1,5 +1,5 @@
SH_FILES := $(wildcard *.sh)
-TEST_FILES := $(filter-out tests-common.sh, $(SH_FILES))
+TEST_FILES := $(filter-out tests-common.sh version-funcs.sh, $(SH_FILES))
TEST_OK_FILES := $(patsubst %.sh, .%.sh.ok,$ $(TEST_FILES))
# We cache a successful test result if the testfile itself did not
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2024-06-13 19:53 Ulrich Müller
0 siblings, 0 replies; 94+ messages in thread
From: Ulrich Müller @ 2024-06-13 19:53 UTC (permalink / raw
To: gentoo-commits
commit: 2d60db117655b37a8c3864f68d30c199a5d3b802
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 13 19:40:54 2024 +0000
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Thu Jun 13 19:53:15 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2d60db11
eclass/tests: Fail the .%.sh.ok Makefile recipe if the test fails
With .ONESHELL active, only the return status of the final recipe line
will be checked.
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
eclass/tests/Makefile | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/eclass/tests/Makefile b/eclass/tests/Makefile
index e5d1c3915fe1..99e824dea86d 100644
--- a/eclass/tests/Makefile
+++ b/eclass/tests/Makefile
@@ -2,18 +2,20 @@ SH_FILES := $(wildcard *.sh)
TEST_FILES := $(filter-out tests-common.sh version-funcs.sh, $(SH_FILES))
TEST_OK_FILES := $(patsubst %.sh, .%.sh.ok,$ $(TEST_FILES))
+# !!! _All_ recipe lines for each target will be provided to a single
+# !!! invocation of the shell.
+.ONESHELL:
+
# We cache a successful test result if the testfile itself did not
# change (%.sh) and the contents of the eclass/ directory did not
# change (.eclasssum).
.%.sh.ok: %.sh .eclasssum
- ./$<
- touch $@
+ ./$< && touch $@
.PHONY: test
test: $(TEST_OK_FILES)
.PHONY: force
-.ONESHELL:
.eclasssum: SHELL = /bin/bash
.eclasssum: force
set -euo pipefail
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2024-07-28 9:32 Ulrich Müller
0 siblings, 0 replies; 94+ messages in thread
From: Ulrich Müller @ 2024-07-28 9:32 UTC (permalink / raw
To: gentoo-commits
commit: 54aa9f031b6b1eb2af5b45ae9fd7d610d2b97f03
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 28 09:23:28 2024 +0000
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sun Jul 28 09:32:32 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=54aa9f03
eclass/tests: Include tests in version-funcs.sh itself
Previously, tests were in eapi7-ver.sh. Update Makefile.
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
eclass/tests/Makefile | 2 +-
eclass/tests/eapi7-ver.sh | 174 ------------------------------------------
eclass/tests/version-funcs.sh | 174 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 175 insertions(+), 175 deletions(-)
diff --git a/eclass/tests/Makefile b/eclass/tests/Makefile
index 99e824dea86d..23027aed6b66 100644
--- a/eclass/tests/Makefile
+++ b/eclass/tests/Makefile
@@ -1,5 +1,5 @@
SH_FILES := $(wildcard *.sh)
-TEST_FILES := $(filter-out tests-common.sh version-funcs.sh, $(SH_FILES))
+TEST_FILES := $(filter-out tests-common.sh, $(SH_FILES))
TEST_OK_FILES := $(patsubst %.sh, .%.sh.ok,$ $(TEST_FILES))
# !!! _All_ recipe lines for each target will be provided to a single
diff --git a/eclass/tests/eapi7-ver.sh b/eclass/tests/eapi7-ver.sh
deleted file mode 100755
index ee7e6d728ef7..000000000000
--- a/eclass/tests/eapi7-ver.sh
+++ /dev/null
@@ -1,174 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-source tests-common.sh || exit
-source version-funcs.sh || exit
-
-teq() {
- local expected=${1}; shift
-
- tbegin "${*} -> ${expected}"
- local got=$("${@}")
- [[ ${got} == ${expected} ]]
- tend ${?} "returned: ${got}"
-}
-
-teqr() {
- local expected=$1; shift
- tbegin "$* -> ${expected}"
- "$@"
- local ret=$?
- [[ ${ret} -eq ${expected} ]]
- tend $? "returned: ${ret}"
-}
-
-txf() {
- tbegin "XFAIL: ${*}"
- local got=$("${@}" 2>&1)
- [[ ${got} == die:* ]]
- tend ${?} "function did not die"
-}
-
-teq 1 ver_cut 1 1.2.3
-teq 1 ver_cut 1-1 1.2.3
-teq 1.2 ver_cut 1-2 1.2.3
-teq 2.3 ver_cut 2- 1.2.3
-teq 1.2.3 ver_cut 1- 1.2.3
-teq 3b ver_cut 3-4 1.2.3b_alpha4
-teq alpha ver_cut 5 1.2.3b_alpha4
-teq 1.2 ver_cut 1-2 .1.2.3
-teq .1.2 ver_cut 0-2 .1.2.3
-teq 2.3 ver_cut 2-3 1.2.3.
-teq 2.3. ver_cut 2- 1.2.3.
-teq 2.3. ver_cut 2-4 1.2.3.
-
-teq 1-2.3 ver_rs 1 - 1.2.3
-teq 1.2-3 ver_rs 2 - 1.2.3
-teq 1-2-3.4 ver_rs 1-2 - 1.2.3.4
-teq 1.2-3-4 ver_rs 2- - 1.2.3.4
-teq 1.2.3 ver_rs 2 . 1.2-3
-teq 1.2.3.a ver_rs 3 . 1.2.3a
-teq 1.2-alpha-4 ver_rs 2-3 - 1.2_alpha4
-teq 1.23-b_alpha4 ver_rs 3 - 2 "" 1.2.3b_alpha4
-teq a1b_2-c-3-d4e5 ver_rs 3-5 _ 4-6 - a1b2c3d4e5
-teq .1-2.3 ver_rs 1 - .1.2.3
-teq -1.2.3 ver_rs 0 - .1.2.3
-
-# truncating range
-teq 1.2 ver_cut 0-2 1.2.3
-teq 2.3 ver_cut 2-5 1.2.3
-teq "" ver_cut 4 1.2.3
-teq "" ver_cut 0 1.2.3
-teq "" ver_cut 4- 1.2.3
-teq 1.2.3 ver_rs 0 - 1.2.3
-teq 1.2.3 ver_rs 3 . 1.2.3
-teq 1.2.3 ver_rs 3- . 1.2.3
-teq 1.2.3 ver_rs 3-5 . 1.2.3
-
-txf ver_cut foo 1.2.3
-txf ver_rs -3 _ a1b2c3d4e5
-txf ver_rs 5-3 _ a1b2c3d4e5
-
-# Tests from Portage's test_vercmp.py
-teqr 0 ver_test 6.0 -gt 5.0
-teqr 0 ver_test 5.0 -gt 5
-teqr 0 ver_test 1.0-r1 -gt 1.0-r0
-teqr 0 ver_test 999999999999999999 -gt 999999999999999998 # 18 digits
-teqr 0 ver_test 1.0.0 -gt 1.0
-teqr 0 ver_test 1.0.0 -gt 1.0b
-teqr 0 ver_test 1b -gt 1
-teqr 0 ver_test 1b_p1 -gt 1_p1
-teqr 0 ver_test 1.1b -gt 1.1
-teqr 0 ver_test 12.2.5 -gt 12.2b
-teqr 0 ver_test 4.0 -lt 5.0
-teqr 0 ver_test 5 -lt 5.0
-teqr 0 ver_test 1.0_pre2 -lt 1.0_p2
-teqr 0 ver_test 1.0_alpha2 -lt 1.0_p2
-teqr 0 ver_test 1.0_alpha1 -lt 1.0_beta1
-teqr 0 ver_test 1.0_beta3 -lt 1.0_rc3
-teqr 0 ver_test 1.001000000000000001 -lt 1.001000000000000002
-teqr 0 ver_test 1.00100000000 -lt 1.001000000000000001
-teqr 0 ver_test 999999999999999998 -lt 999999999999999999
-teqr 0 ver_test 1.01 -lt 1.1
-teqr 0 ver_test 1.0-r0 -lt 1.0-r1
-teqr 0 ver_test 1.0 -lt 1.0-r1
-teqr 0 ver_test 1.0 -lt 1.0.0
-teqr 0 ver_test 1.0b -lt 1.0.0
-teqr 0 ver_test 1_p1 -lt 1b_p1
-teqr 0 ver_test 1 -lt 1b
-teqr 0 ver_test 1.1 -lt 1.1b
-teqr 0 ver_test 12.2b -lt 12.2.5
-teqr 0 ver_test 4.0 -eq 4.0
-teqr 0 ver_test 1.0 -eq 1.0
-teqr 0 ver_test 1.0-r0 -eq 1.0
-teqr 0 ver_test 1.0 -eq 1.0-r0
-teqr 0 ver_test 1.0-r0 -eq 1.0-r0
-teqr 0 ver_test 1.0-r1 -eq 1.0-r1
-teqr 1 ver_test 1 -eq 2
-teqr 1 ver_test 1.0_alpha -eq 1.0_pre
-teqr 1 ver_test 1.0_beta -eq 1.0_alpha
-teqr 1 ver_test 1 -eq 0.0
-teqr 1 ver_test 1.0-r0 -eq 1.0-r1
-teqr 1 ver_test 1.0-r1 -eq 1.0-r0
-teqr 1 ver_test 1.0 -eq 1.0-r1
-teqr 1 ver_test 1.0-r1 -eq 1.0
-teqr 1 ver_test 1.0 -eq 1.0.0
-teqr 1 ver_test 1_p1 -eq 1b_p1
-teqr 1 ver_test 1b -eq 1
-teqr 1 ver_test 1.1b -eq 1.1
-teqr 1 ver_test 12.2b -eq 12.2
-
-# A subset of tests from Paludis
-teqr 0 ver_test 1.0_alpha -gt 1_alpha
-teqr 0 ver_test 1.0_alpha -gt 1
-teqr 0 ver_test 1.0_alpha -lt 1.0
-teqr 0 ver_test 1.2.0.0_alpha7-r4 -gt 1.2_alpha7-r4
-teqr 0 ver_test 0001 -eq 1
-teqr 0 ver_test 01 -eq 001
-teqr 0 ver_test 0001.1 -eq 1.1
-teqr 0 ver_test 01.01 -eq 1.01
-teqr 0 ver_test 1.010 -eq 1.01
-teqr 0 ver_test 1.00 -eq 1.0
-teqr 0 ver_test 1.0100 -eq 1.010
-teqr 0 ver_test 1-r00 -eq 1-r0
-
-# Additional tests
-teqr 0 ver_test 0_rc99 -lt 0
-teqr 0 ver_test 011 -eq 11
-teqr 0 ver_test 019 -eq 19
-teqr 0 ver_test 1.2 -eq 001.2
-teqr 0 ver_test 1.2 -gt 1.02
-teqr 0 ver_test 1.2a -lt 1.2b
-teqr 0 ver_test 1.2_pre1 -gt 1.2_pre1_beta2
-teqr 0 ver_test 1.2_pre1 -lt 1.2_pre1_p2
-teqr 0 ver_test 1.00 -lt 1.0.0
-teqr 0 ver_test 1.010 -eq 1.01
-teqr 0 ver_test 1.01 -lt 1.1
-teqr 0 ver_test 1.2_pre08-r09 -eq 1.2_pre8-r9
-teqr 0 ver_test 0 -lt 576460752303423488 # 2**59
-teqr 0 ver_test 0 -lt 9223372036854775808 # 2**63
-
-# Bad number or ordering of arguments
-txf ver_test 1
-txf ver_test 1 -lt 2 3
-txf ver_test -lt 1 2
-
-# Bad operators
-txf ver_test 1 "<" 2
-txf ver_test 1 lt 2
-txf ver_test 1 -foo 2
-
-# Malformed versions
-txf ver_test "" -ne 1
-txf ver_test 1. -ne 1
-txf ver_test 1ab -ne 1
-txf ver_test b -ne 1
-txf ver_test 1-r1_pre -ne 1
-txf ver_test 1-pre1 -ne 1
-txf ver_test 1_foo -ne 1
-txf ver_test 1_pre1.1 -ne 1
-txf ver_test 1-r1.0 -ne 1
-txf ver_test cvs.9999 -ne 9999
-
-texit
diff --git a/eclass/tests/version-funcs.sh b/eclass/tests/version-funcs.sh
old mode 100644
new mode 100755
index 6e83c01666f0..cb2a92342c65
--- a/eclass/tests/version-funcs.sh
+++ b/eclass/tests/version-funcs.sh
@@ -300,3 +300,177 @@ ver_test() {
_ver_compare "${va}" "${vb}"
test $? "${op}" 2
}
+
+# Return if we are being sourced
+return 2>/dev/null
+
+
+source tests-common.sh || exit
+
+teq() {
+ local expected=${1}; shift
+
+ tbegin "${*} -> ${expected}"
+ local got=$("${@}")
+ [[ ${got} == ${expected} ]]
+ tend ${?} "returned: ${got}"
+}
+
+teqr() {
+ local expected=$1; shift
+ tbegin "$* -> ${expected}"
+ "$@"
+ local ret=$?
+ [[ ${ret} -eq ${expected} ]]
+ tend $? "returned: ${ret}"
+}
+
+txf() {
+ tbegin "XFAIL: ${*}"
+ local got=$("${@}" 2>&1)
+ [[ ${got} == die:* ]]
+ tend ${?} "function did not die"
+}
+
+teq 1 ver_cut 1 1.2.3
+teq 1 ver_cut 1-1 1.2.3
+teq 1.2 ver_cut 1-2 1.2.3
+teq 2.3 ver_cut 2- 1.2.3
+teq 1.2.3 ver_cut 1- 1.2.3
+teq 3b ver_cut 3-4 1.2.3b_alpha4
+teq alpha ver_cut 5 1.2.3b_alpha4
+teq 1.2 ver_cut 1-2 .1.2.3
+teq .1.2 ver_cut 0-2 .1.2.3
+teq 2.3 ver_cut 2-3 1.2.3.
+teq 2.3. ver_cut 2- 1.2.3.
+teq 2.3. ver_cut 2-4 1.2.3.
+
+teq 1-2.3 ver_rs 1 - 1.2.3
+teq 1.2-3 ver_rs 2 - 1.2.3
+teq 1-2-3.4 ver_rs 1-2 - 1.2.3.4
+teq 1.2-3-4 ver_rs 2- - 1.2.3.4
+teq 1.2.3 ver_rs 2 . 1.2-3
+teq 1.2.3.a ver_rs 3 . 1.2.3a
+teq 1.2-alpha-4 ver_rs 2-3 - 1.2_alpha4
+teq 1.23-b_alpha4 ver_rs 3 - 2 "" 1.2.3b_alpha4
+teq a1b_2-c-3-d4e5 ver_rs 3-5 _ 4-6 - a1b2c3d4e5
+teq .1-2.3 ver_rs 1 - .1.2.3
+teq -1.2.3 ver_rs 0 - .1.2.3
+
+# truncating range
+teq 1.2 ver_cut 0-2 1.2.3
+teq 2.3 ver_cut 2-5 1.2.3
+teq "" ver_cut 4 1.2.3
+teq "" ver_cut 0 1.2.3
+teq "" ver_cut 4- 1.2.3
+teq 1.2.3 ver_rs 0 - 1.2.3
+teq 1.2.3 ver_rs 3 . 1.2.3
+teq 1.2.3 ver_rs 3- . 1.2.3
+teq 1.2.3 ver_rs 3-5 . 1.2.3
+
+txf ver_cut foo 1.2.3
+txf ver_rs -3 _ a1b2c3d4e5
+txf ver_rs 5-3 _ a1b2c3d4e5
+
+# Tests from Portage's test_vercmp.py
+teqr 0 ver_test 6.0 -gt 5.0
+teqr 0 ver_test 5.0 -gt 5
+teqr 0 ver_test 1.0-r1 -gt 1.0-r0
+teqr 0 ver_test 999999999999999999 -gt 999999999999999998 # 18 digits
+teqr 0 ver_test 1.0.0 -gt 1.0
+teqr 0 ver_test 1.0.0 -gt 1.0b
+teqr 0 ver_test 1b -gt 1
+teqr 0 ver_test 1b_p1 -gt 1_p1
+teqr 0 ver_test 1.1b -gt 1.1
+teqr 0 ver_test 12.2.5 -gt 12.2b
+teqr 0 ver_test 4.0 -lt 5.0
+teqr 0 ver_test 5 -lt 5.0
+teqr 0 ver_test 1.0_pre2 -lt 1.0_p2
+teqr 0 ver_test 1.0_alpha2 -lt 1.0_p2
+teqr 0 ver_test 1.0_alpha1 -lt 1.0_beta1
+teqr 0 ver_test 1.0_beta3 -lt 1.0_rc3
+teqr 0 ver_test 1.001000000000000001 -lt 1.001000000000000002
+teqr 0 ver_test 1.00100000000 -lt 1.001000000000000001
+teqr 0 ver_test 999999999999999998 -lt 999999999999999999
+teqr 0 ver_test 1.01 -lt 1.1
+teqr 0 ver_test 1.0-r0 -lt 1.0-r1
+teqr 0 ver_test 1.0 -lt 1.0-r1
+teqr 0 ver_test 1.0 -lt 1.0.0
+teqr 0 ver_test 1.0b -lt 1.0.0
+teqr 0 ver_test 1_p1 -lt 1b_p1
+teqr 0 ver_test 1 -lt 1b
+teqr 0 ver_test 1.1 -lt 1.1b
+teqr 0 ver_test 12.2b -lt 12.2.5
+teqr 0 ver_test 4.0 -eq 4.0
+teqr 0 ver_test 1.0 -eq 1.0
+teqr 0 ver_test 1.0-r0 -eq 1.0
+teqr 0 ver_test 1.0 -eq 1.0-r0
+teqr 0 ver_test 1.0-r0 -eq 1.0-r0
+teqr 0 ver_test 1.0-r1 -eq 1.0-r1
+teqr 1 ver_test 1 -eq 2
+teqr 1 ver_test 1.0_alpha -eq 1.0_pre
+teqr 1 ver_test 1.0_beta -eq 1.0_alpha
+teqr 1 ver_test 1 -eq 0.0
+teqr 1 ver_test 1.0-r0 -eq 1.0-r1
+teqr 1 ver_test 1.0-r1 -eq 1.0-r0
+teqr 1 ver_test 1.0 -eq 1.0-r1
+teqr 1 ver_test 1.0-r1 -eq 1.0
+teqr 1 ver_test 1.0 -eq 1.0.0
+teqr 1 ver_test 1_p1 -eq 1b_p1
+teqr 1 ver_test 1b -eq 1
+teqr 1 ver_test 1.1b -eq 1.1
+teqr 1 ver_test 12.2b -eq 12.2
+
+# A subset of tests from Paludis
+teqr 0 ver_test 1.0_alpha -gt 1_alpha
+teqr 0 ver_test 1.0_alpha -gt 1
+teqr 0 ver_test 1.0_alpha -lt 1.0
+teqr 0 ver_test 1.2.0.0_alpha7-r4 -gt 1.2_alpha7-r4
+teqr 0 ver_test 0001 -eq 1
+teqr 0 ver_test 01 -eq 001
+teqr 0 ver_test 0001.1 -eq 1.1
+teqr 0 ver_test 01.01 -eq 1.01
+teqr 0 ver_test 1.010 -eq 1.01
+teqr 0 ver_test 1.00 -eq 1.0
+teqr 0 ver_test 1.0100 -eq 1.010
+teqr 0 ver_test 1-r00 -eq 1-r0
+
+# Additional tests
+teqr 0 ver_test 0_rc99 -lt 0
+teqr 0 ver_test 011 -eq 11
+teqr 0 ver_test 019 -eq 19
+teqr 0 ver_test 1.2 -eq 001.2
+teqr 0 ver_test 1.2 -gt 1.02
+teqr 0 ver_test 1.2a -lt 1.2b
+teqr 0 ver_test 1.2_pre1 -gt 1.2_pre1_beta2
+teqr 0 ver_test 1.2_pre1 -lt 1.2_pre1_p2
+teqr 0 ver_test 1.00 -lt 1.0.0
+teqr 0 ver_test 1.010 -eq 1.01
+teqr 0 ver_test 1.01 -lt 1.1
+teqr 0 ver_test 1.2_pre08-r09 -eq 1.2_pre8-r9
+teqr 0 ver_test 0 -lt 576460752303423488 # 2**59
+teqr 0 ver_test 0 -lt 9223372036854775808 # 2**63
+
+# Bad number or ordering of arguments
+txf ver_test 1
+txf ver_test 1 -lt 2 3
+txf ver_test -lt 1 2
+
+# Bad operators
+txf ver_test 1 "<" 2
+txf ver_test 1 lt 2
+txf ver_test 1 -foo 2
+
+# Malformed versions
+txf ver_test "" -ne 1
+txf ver_test 1. -ne 1
+txf ver_test 1ab -ne 1
+txf ver_test b -ne 1
+txf ver_test 1-r1_pre -ne 1
+txf ver_test 1-pre1 -ne 1
+txf ver_test 1_foo -ne 1
+txf ver_test 1_pre1.1 -ne 1
+txf ver_test 1-r1.0 -ne 1
+txf ver_test cvs.9999 -ne 9999
+
+texit
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2024-07-29 17:02 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2024-07-29 17:02 UTC (permalink / raw
To: gentoo-commits
commit: ac3849073fc4fc19b4872e7840ff12d66ab54b15
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 29 15:40:10 2024 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Jul 29 17:02:40 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ac384907
llvm-r1.eclass: Update tests for new stable
Closes: https://bugs.gentoo.org/936882
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/llvm-r1.sh | 26 +++++++++++++++++---------
1 file changed, 17 insertions(+), 9 deletions(-)
diff --git a/eclass/tests/llvm-r1.sh b/eclass/tests/llvm-r1.sh
index 9958f5bba420..8583fd6c799b 100755
--- a/eclass/tests/llvm-r1.sh
+++ b/eclass/tests/llvm-r1.sh
@@ -121,22 +121,30 @@ test_fix_tool_path() {
tend ${?}
}
+# full range
+test_globals '14 15 16 17 18 19' \
+ "+llvm_slot_18 llvm_slot_15 llvm_slot_16 llvm_slot_17 llvm_slot_19" \
+ "^^ ( llvm_slot_15 llvm_slot_16 llvm_slot_17 llvm_slot_18 llvm_slot_19 )" \
+ "llvm_slot_15(-)?,llvm_slot_16(-)?,llvm_slot_17(-)?,llvm_slot_18(-)?,llvm_slot_19(-)?"
test_globals '14 15 16 17 18' \
- "+llvm_slot_17 llvm_slot_15 llvm_slot_16 llvm_slot_18" \
+ "+llvm_slot_18 llvm_slot_15 llvm_slot_16 llvm_slot_17" \
"^^ ( llvm_slot_15 llvm_slot_16 llvm_slot_17 llvm_slot_18 )" \
"llvm_slot_15(-)?,llvm_slot_16(-)?,llvm_slot_17(-)?,llvm_slot_18(-)?"
+# older than stable
test_globals '14 15 16' \
"+llvm_slot_16 llvm_slot_15" \
"^^ ( llvm_slot_15 llvm_slot_16 )" \
"llvm_slot_15(-)?,llvm_slot_16(-)?"
-test_globals '15 18' \
- "+llvm_slot_15 llvm_slot_18" \
- "^^ ( llvm_slot_15 llvm_slot_18 )" \
- "llvm_slot_15(-)?,llvm_slot_18(-)?"
-test_globals '18' \
- "+llvm_slot_18" \
- "^^ ( llvm_slot_18 )" \
- "llvm_slot_18(-)?"
+# old + newer than current stable
+test_globals '15 19' \
+ "+llvm_slot_15 llvm_slot_19" \
+ "^^ ( llvm_slot_15 llvm_slot_19 )" \
+ "llvm_slot_15(-)?,llvm_slot_19(-)?"
+# newer than current stable
+test_globals '19' \
+ "+llvm_slot_19" \
+ "^^ ( llvm_slot_19 )" \
+ "llvm_slot_19(-)?"
LLVM_COMPAT=( {14..18} )
inherit llvm-r1
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2024-08-06 8:47 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2024-08-06 8:47 UTC (permalink / raw
To: gentoo-commits
commit: f14c9139aac5679ad4827e4b69d8bc6a5e3042cc
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 5 14:06:43 2024 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Aug 6 08:28:53 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f14c9139
eclass/tests/toolchain-funcs.sh: Cover tc-is-lto
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/37976
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/toolchain-funcs.sh | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/eclass/tests/toolchain-funcs.sh b/eclass/tests/toolchain-funcs.sh
index ee10ddf50c1e..6bfb00ff6bcb 100755
--- a/eclass/tests/toolchain-funcs.sh
+++ b/eclass/tests/toolchain-funcs.sh
@@ -210,6 +210,16 @@ if type -P gcc &>/dev/null; then
tbegin "tc-get-c-rtlib (gcc)"
[[ $(CC=gcc tc-get-c-rtlib) == libgcc ]]
tend $?
+
+ tbegin "tc-is-lto (gcc, -fno-lto)"
+ CC=gcc CFLAGS=-fno-lto tc-is-lto
+ [[ $? -eq 1 ]]
+ tend $?
+
+ tbegin "tc-is-lto (gcc, -flto)"
+ CC=gcc CFLAGS=-flto tc-is-lto
+ [[ $? -eq 0 ]]
+ tend $?
fi
if type -P clang &>/dev/null; then
@@ -232,6 +242,16 @@ if type -P clang &>/dev/null; then
[[ $(CC=clang CFLAGS="--rtlib=${rtlib}" tc-get-c-rtlib) == ${rtlib} ]]
tend $?
done
+
+ tbegin "tc-is-lto (clang, -fno-lto)"
+ CC=clang CFLAGS=-fno-lto tc-is-lto
+ [[ $? -eq 1 ]]
+ tend $?
+
+ tbegin "tc-is-lto (clang, -flto)"
+ CC=clang CFLAGS=-flto tc-is-lto
+ [[ $? -eq 0 ]]
+ tend $?
fi
texit
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2024-08-06 8:47 Michał Górny
0 siblings, 0 replies; 94+ messages in thread
From: Michał Górny @ 2024-08-06 8:47 UTC (permalink / raw
To: gentoo-commits
commit: 69190f6268a2a6942e5a266a45e2b353cf617569
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 6 06:27:14 2024 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Aug 6 08:29:02 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=69190f62
eclass/tests/toolchain-funcs.sh: Cover tc-has-64bit-time_t
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/37142
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/tests/toolchain-funcs.sh | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/eclass/tests/toolchain-funcs.sh b/eclass/tests/toolchain-funcs.sh
index 6bfb00ff6bcb..0d6745862148 100755
--- a/eclass/tests/toolchain-funcs.sh
+++ b/eclass/tests/toolchain-funcs.sh
@@ -220,6 +220,26 @@ if type -P gcc &>/dev/null; then
CC=gcc CFLAGS=-flto tc-is-lto
[[ $? -eq 0 ]]
tend $?
+
+ case $(gcc -dumpmachine) in
+ i*86*-gnu*|arm*-gnu*|powerpc-*-gnu)
+ tbegin "tc-has-64bit-time_t (_TIME_BITS=32)"
+ CC=gcc CFLAGS="-U_TIME_BITS -D_TIME_BITS=32" tc-has-64bit-time_t
+ [[ $? -eq 1 ]]
+ tend $?
+
+ tbegin "tc-has-64bit-time_t (_TIME_BITS=64)"
+ CC=gcc CFLAGS="-U_FILE_OFFSET_BITS -U_TIME_BITS -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64" tc-has-64bit-time_t
+ [[ $? -eq 0 ]]
+ tend $?
+ ;;
+ *)
+ tbegin "tc-has-64bit-time_t"
+ CC=gcc tc-has-64bit-time_t
+ [[ $? -eq 0 ]]
+ tend $?
+ ;;
+ esac
fi
if type -P clang &>/dev/null; then
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2024-08-07 8:58 Andrew Ammerlaan
0 siblings, 0 replies; 94+ messages in thread
From: Andrew Ammerlaan @ 2024-08-07 8:58 UTC (permalink / raw
To: gentoo-commits
commit: 91990a04b76e591ffe959f5101645f44cb83c730
Author: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 6 09:38:12 2024 +0000
Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
CommitDate: Wed Aug 7 08:58:40 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=91990a04
eclass/tests/tests-common.sh: add in_iuse function
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>
eclass/tests/tests-common.sh | 2 ++
1 file changed, 2 insertions(+)
diff --git a/eclass/tests/tests-common.sh b/eclass/tests/tests-common.sh
index 45b1e20b933a..f4e18f38fee9 100644
--- a/eclass/tests/tests-common.sh
+++ b/eclass/tests/tests-common.sh
@@ -55,6 +55,8 @@ has() {
}
use() { has "$1" ${IUSE} ; }
+in_iuse() { use "$@" ; }
+
die() {
echo "die: $*" 1>&2
exit 1
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2024-08-07 8:58 Andrew Ammerlaan
0 siblings, 0 replies; 94+ messages in thread
From: Andrew Ammerlaan @ 2024-08-07 8:58 UTC (permalink / raw
To: gentoo-commits
commit: 03e930a67cb99b686188d74e5f2168506b0447aa
Author: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 6 09:38:34 2024 +0000
Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
CommitDate: Wed Aug 7 08:58:41 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=03e930a6
eclass/tests/dist-kernel-utils.sh: add compressed_module_cleanup tests
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/37985
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>
eclass/tests/dist-kernel-utils.sh | 59 +++++++++++++++++++++++++++++++++++++++
1 file changed, 59 insertions(+)
diff --git a/eclass/tests/dist-kernel-utils.sh b/eclass/tests/dist-kernel-utils.sh
index 50ba001f8e9c..28c8f7213a53 100755
--- a/eclass/tests/dist-kernel-utils.sh
+++ b/eclass/tests/dist-kernel-utils.sh
@@ -20,9 +20,68 @@ test_PV_to_KV() {
tend $?
}
+test_compressed_module_cleanup() {
+ mkdir -p "${tmpdir}/source" || die
+ pushd "${tmpdir}" >/dev/null || die
+
+ local module option fail=0
+ for option in NONE GZIP XZ ZSTD; do
+ tbegin "CONFIG_MODULE_COMPRESS_${option}"
+ echo "CONFIG_MODULE_COMPRESS_${option}=y" > source/.config
+
+ touch a.ko b.ko.gz c.ko.xz d.ko.gz e.ko f.ko.xz || die
+ # ensure some files are older
+ touch -d "2 hours ago" d.ko e.ko.xz f.ko.gz || die
+
+ IUSE=modules-compress dist-kernel_compressed_module_cleanup .
+
+ local to_keep=( a.ko b.ko.gz c.ko.xz )
+ local to_remove=()
+
+ case ${option} in
+ NONE)
+ to_keep+=( d.ko e.ko f.ko.xz )
+ to_remove+=( d.ko.gz e.ko.xz f.ko.gz )
+ ;;
+ GZIP)
+ to_keep+=( d.ko.gz e.ko f.ko.gz )
+ to_remove+=( d.ko e.ko.xz f.ko.xz )
+ ;;
+ XZ)
+ to_keep+=( d.ko.gz e.ko.xz f.ko.xz )
+ to_remove+=( d.ko e.ko f.ko.gz )
+ ;;
+ ZSTD)
+ to_keep+=( d.ko.gz e.ko f.ko.xz )
+ to_remove+=( d.ko e.ko.xz f.ko.gz )
+ ;;
+ esac
+
+ for module in "${to_keep[@]}"; do
+ if [[ ! -f ${module} ]]; then
+ eerror "Module ${module} was removed"
+ fail=1
+ fi
+ done
+
+ for module in "${to_remove[@]}"; do
+ if [[ -f ${module} ]]; then
+ eerror "Module ${module} was not removed"
+ fail=1
+ fi
+ done
+ tend ${fail}
+ done
+
+ popd >/dev/null || die
+}
+
+
test_PV_to_KV 6.0_rc1 6.0.0-rc1
test_PV_to_KV 6.0 6.0.0
test_PV_to_KV 6.0.1_rc1 6.0.1-rc1
test_PV_to_KV 6.0.1 6.0.1
+test_compressed_module_cleanup
+
texit
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2024-09-18 15:51 Sam James
0 siblings, 0 replies; 94+ messages in thread
From: Sam James @ 2024-09-18 15:51 UTC (permalink / raw
To: gentoo-commits
commit: 992fc2954c2281285bc50156ba12d310a1b434e1
Author: Petr Vaněk <arkamar <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 18 11:30:12 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Sep 18 15:49:09 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=992fc295
eclass/tests/toolchain.sh: declare PYTHON_COMPAT
toolchain.sh test script requires PYTHON_COMPAT array since commit
1d93a491096f ("toolchain.eclass: rework tests more") otherwise it dies
with
die: PYTHON_COMPAT not declared.
error.
Bug: https://bugs.gentoo.org/859157
Signed-off-by: Petr Vaněk <arkamar <AT> gentoo.org>
Signed-off-by: Sam James <sam <AT> gentoo.org>
eclass/tests/toolchain.sh | 2 ++
1 file changed, 2 insertions(+)
diff --git a/eclass/tests/toolchain.sh b/eclass/tests/toolchain.sh
index 6f8df5b4fc4a..2e48c3443493 100755
--- a/eclass/tests/toolchain.sh
+++ b/eclass/tests/toolchain.sh
@@ -11,6 +11,8 @@ PR=r0
source tests-common.sh || exit
source version-funcs.sh || exit
+PYTHON_COMPAT=( python3_{10..13} )
+
EAPI=7 inherit toolchain
# Ignore actually running version of gcc and fake new version
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2024-09-18 15:51 Sam James
0 siblings, 0 replies; 94+ messages in thread
From: Sam James @ 2024-09-18 15:51 UTC (permalink / raw
To: gentoo-commits
commit: 3f3bfeac6adc6b4e9db50b1204c1a398523c55b1
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 18 15:49:34 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Sep 18 15:49:34 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3f3bfeac
Revert "eclass/tests/toolchain.sh: declare PYTHON_COMPAT"
This reverts commit 992fc2954c2281285bc50156ba12d310a1b434e1.
This should no longer be necessary now that tests are opt-in
with TOOLCHAIN_HAS_TESTS.
Bug: https://bugs.gentoo.org/859157
Signed-off-by: Sam James <sam <AT> gentoo.org>
eclass/tests/toolchain.sh | 2 --
1 file changed, 2 deletions(-)
diff --git a/eclass/tests/toolchain.sh b/eclass/tests/toolchain.sh
index 2e48c3443493..6f8df5b4fc4a 100755
--- a/eclass/tests/toolchain.sh
+++ b/eclass/tests/toolchain.sh
@@ -11,8 +11,6 @@ PR=r0
source tests-common.sh || exit
source version-funcs.sh || exit
-PYTHON_COMPAT=( python3_{10..13} )
-
EAPI=7 inherit toolchain
# Ignore actually running version of gcc and fake new version
^ permalink raw reply related [flat|nested] 94+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: eclass/tests/
@ 2024-09-19 4:13 Sam James
0 siblings, 0 replies; 94+ messages in thread
From: Sam James @ 2024-09-19 4:13 UTC (permalink / raw
To: gentoo-commits
commit: 0e3fcf7b631e7afe04af8ac80bae2759d222d2de
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 19 04:12:46 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Sep 19 04:13:46 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0e3fcf7b
eclass/tests: fix toolchain.sh tests by dropping old GCC support
eb49d171430cc2baffbf9d37493a78cc02b33fe2 dropped old GCC support but
the tests weren't updated.
Closes: https://bugs.gentoo.org/939817
Fixes: eb49d171430cc2baffbf9d37493a78cc02b33fe2
Signed-off-by: Sam James <sam <AT> gentoo.org>
eclass/tests/toolchain.sh | 17 -----------------
1 file changed, 17 deletions(-)
diff --git a/eclass/tests/toolchain.sh b/eclass/tests/toolchain.sh
index 6f8df5b4fc4a..1ba2e6b1f29d 100755
--- a/eclass/tests/toolchain.sh
+++ b/eclass/tests/toolchain.sh
@@ -49,10 +49,6 @@ test_downgrade_arch_flags 4.5 "-march=core2" "-march=haswell"
test_downgrade_arch_flags 4.4 "-march=core2" "-march=haswell"
test_downgrade_arch_flags 4.3 "-march=core2" "-march=haswell"
test_downgrade_arch_flags 4.2 "-march=nocona" "-march=haswell"
-test_downgrade_arch_flags 4.1 "-march=nocona" "-march=haswell"
-test_downgrade_arch_flags 4.0 "-march=nocona" "-march=haswell"
-test_downgrade_arch_flags 3.4 "-march=nocona" "-march=haswell"
-test_downgrade_arch_flags 3.3 "-march=nocona" "-march=haswell"
test_downgrade_arch_flags 4.9 "-march=bdver4" "-march=bdver4"
test_downgrade_arch_flags 4.8 "-march=bdver3" "-march=bdver4"
@@ -62,31 +58,18 @@ test_downgrade_arch_flags 4.5 "-march=amdfam10" "-march=bdver4"
test_downgrade_arch_flags 4.4 "-march=amdfam10" "-march=bdver4"
test_downgrade_arch_flags 4.3 "-march=amdfam10" "-march=bdver4"
test_downgrade_arch_flags 4.2 "-march=k8" "-march=bdver4"
-test_downgrade_arch_flags 4.1 "-march=k8" "-march=bdver4"
-test_downgrade_arch_flags 4.0 "-march=k8" "-march=bdver4"
-test_downgrade_arch_flags 3.4 "-march=k8" "-march=bdver4"
-test_downgrade_arch_flags 3.3 "-march=x86-64" "-march=bdver4"
-
-test_downgrade_arch_flags 3.4 "-march=c3-2" "-march=c3-2"
-test_downgrade_arch_flags 3.3 "-march=c3" "-march=c3-2"
test_downgrade_arch_flags 4.5 "-march=garbage" "-march=garbage"
test_downgrade_arch_flags 10 "-mtune=intel" "-mtune=intel"
test_downgrade_arch_flags 4.9 "-mtune=intel" "-mtune=intel"
test_downgrade_arch_flags 4.8 "-mtune=generic" "-mtune=intel"
-test_downgrade_arch_flags 3.4 "" "-mtune=generic"
-test_downgrade_arch_flags 3.4 "" "-mtune=x86-64"
-test_downgrade_arch_flags 3.3 "" "-mtune=anything"
test_downgrade_arch_flags 4.5 "-march=amdfam10 -mtune=generic" "-march=btver2 -mtune=generic"
-test_downgrade_arch_flags 3.3 "-march=k6-2" "-march=geode -mtune=barcelona"
-test_downgrade_arch_flags 3.4 "-march=k8" "-march=btver2 -mtune=generic"
test_downgrade_arch_flags 10 "-march=native" "-march=native"
test_downgrade_arch_flags 8 "-march=znver1" "-march=znver2"
test_downgrade_arch_flags 4.2 "-march=native" "-march=native"
-test_downgrade_arch_flags 4.1 "-march=nocona" "-march=native"
test_downgrade_arch_flags 9 "-march=znver2" "-march=znver3"
test_downgrade_arch_flags 10 "-march=foo -mno-sha -mno-rtm -mno-avx2 -mno-avx -mno-sse4.1" "-march=foo -mno-sha -mno-rtm -mno-avx2 -mno-avx -mno-sse4.1"
^ permalink raw reply related [flat|nested] 94+ messages in thread
end of thread, other threads:[~2024-09-19 4:14 UTC | newest]
Thread overview: 94+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-09 20:32 [gentoo-commits] repo/gentoo:master commit in: eclass/tests/ Sergei Trofimovich
-- strict thread matches above, loose matches on Subject: below --
2024-09-19 4:13 Sam James
2024-09-18 15:51 Sam James
2024-09-18 15:51 Sam James
2024-08-07 8:58 Andrew Ammerlaan
2024-08-07 8:58 Andrew Ammerlaan
2024-08-06 8:47 Michał Górny
2024-08-06 8:47 Michał Górny
2024-07-29 17:02 Michał Górny
2024-07-28 9:32 Ulrich Müller
2024-06-13 19:53 Ulrich Müller
2024-06-13 19:53 Ulrich Müller
2024-06-13 18:35 Ulrich Müller
2024-06-13 18:35 Ulrich Müller
2024-06-12 16:47 Ulrich Müller
2024-06-12 15:35 Michał Górny
2024-06-12 15:32 Ulrich Müller
2024-06-12 9:47 Ulrich Müller
2024-05-25 8:24 Ulrich Müller
2023-11-03 19:00 Michał Górny
2023-09-14 5:30 Michał Górny
2023-06-18 14:57 Michał Górny
2023-06-17 10:10 Michał Górny
2023-06-15 12:19 Michał Górny
2023-05-23 4:36 Michał Górny
2023-05-01 13:43 Sam James
2023-04-20 23:14 Sam James
2022-12-14 10:18 Michał Górny
2022-10-28 8:24 Michał Górny
2022-10-15 17:35 Mike Gilbert
2022-10-10 20:52 Michał Górny
2022-10-01 17:19 Michał Górny
2022-10-01 17:19 Michał Górny
2022-09-27 20:28 Michał Górny
2022-05-09 20:33 Michał Górny
2022-05-09 20:33 Michał Górny
2022-04-21 15:19 Michał Górny
2022-04-19 21:32 Mike Gilbert
2022-02-14 21:13 Mike Gilbert
2022-02-14 17:25 Mike Gilbert
2021-12-31 9:10 Michał Górny
2021-12-31 9:10 Michał Górny
2021-12-31 9:10 Michał Górny
2021-06-22 20:44 David Seifert
2021-05-12 20:55 Mike Gilbert
2021-05-12 19:39 Michał Górny
2021-05-05 18:20 Michał Górny
2021-03-28 11:48 Michał Górny
2020-11-23 18:11 Ulrich Müller
2020-07-02 8:29 Michał Górny
2020-07-02 8:29 Michał Górny
2020-07-02 8:29 Michał Górny
2020-07-02 8:29 Michał Górny
2020-06-19 11:52 Michał Górny
2020-05-28 11:41 Michał Górny
2020-05-10 1:02 Sergei Trofimovich
2020-04-30 9:45 Michał Górny
2020-04-19 16:47 Michał Górny
2020-03-30 13:11 Michał Górny
2020-03-30 11:57 Michał Górny
2020-03-27 23:54 Sergei Trofimovich
2020-02-27 16:29 Michał Górny
2020-02-09 18:09 Michał Górny
2019-12-23 11:47 Sergei Trofimovich
2019-12-13 22:37 Sergei Trofimovich
2019-12-07 16:59 Michał Górny
2019-12-01 11:29 Sergei Trofimovich
2019-11-24 15:09 Michał Górny
2019-11-20 20:30 Sergei Trofimovich
2019-11-20 19:51 Sergei Trofimovich
2019-11-20 9:23 Michał Górny
2019-11-20 9:16 Michał Górny
2019-11-20 9:15 Michał Górny
2019-11-20 9:00 Michał Górny
2019-11-20 9:00 Michał Górny
2019-11-20 9:00 Michał Górny
2019-11-20 8:46 Michał Górny
2019-11-20 8:46 Michał Górny
2019-11-20 8:46 Michał Górny
2019-11-20 7:47 Michał Górny
2019-11-06 22:44 Sergei Trofimovich
2018-12-09 20:32 Sergei Trofimovich
2018-12-09 20:32 Sergei Trofimovich
2017-09-19 13:15 Michał Górny
2017-09-14 19:05 Mike Gilbert
2017-08-08 19:42 Michał Górny
2017-04-14 16:28 Michał Górny
2017-03-08 7:35 Michał Górny
2016-06-27 5:58 Michał Górny
2016-01-08 5:14 Michał Górny
2015-12-09 20:42 Michał Górny
2015-11-21 19:58 Ulrich Müller
2015-11-12 16:03 Michał Górny
2015-11-11 10:27 Michał Górny
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox