public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:eapi7-ver commit in: eclass/tests/
@ 2017-09-06 13:48 Michał Górny
  0 siblings, 0 replies; 7+ messages in thread
From: Michał Górny @ 2017-09-06 13:48 UTC (permalink / raw
  To: gentoo-commits

commit:     7beb8b057de660360b543fd090c3972cc3316b93
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Sep  6 13:48:17 2017 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Sep  6 13:48:17 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7beb8b05

eapi7-ver.eclass: Enable invalid range syntax tests

 eclass/tests/eapi7-ver.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/eclass/tests/eapi7-ver.sh b/eclass/tests/eapi7-ver.sh
index 2bac732018b..4a1315e42f3 100755
--- a/eclass/tests/eapi7-ver.sh
+++ b/eclass/tests/eapi7-ver.sh
@@ -40,4 +40,5 @@ teq .1-2.3 version_rs 1 - .1.2.3
 teq -1.2.3 version_rs 0 - .1.2.3
 
 txf version_cut foo 1.2.3
-#txf version_rs 5-3 _ a1b2c3d4e5
+txf version_rs -3 _ a1b2c3d4e5
+txf version_rs 5-3 _ a1b2c3d4e5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] repo/gentoo:eapi7-ver commit in: eclass/tests/
@ 2017-09-06 15:00 Michał Górny
  0 siblings, 0 replies; 7+ messages in thread
From: Michał Górny @ 2017-09-06 15:00 UTC (permalink / raw
  To: gentoo-commits

commit:     a3c6899e26bb97644ba7aa919db794854172be5a
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Sep  6 14:59:17 2017 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Sep  6 14:59:17 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a3c6899e

eapi7-ver.eclass: Add some trivial benchmark

 eclass/tests/eapi7-ver:benchmark.sh | 73 +++++++++++++++++++++++++++++++++++++
 1 file changed, 73 insertions(+)

diff --git a/eclass/tests/eapi7-ver:benchmark.sh b/eclass/tests/eapi7-ver:benchmark.sh
new file mode 100755
index 00000000000..6a1001473b4
--- /dev/null
+++ b/eclass/tests/eapi7-ver:benchmark.sh
@@ -0,0 +1,73 @@
+#!/bin/bash
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+source tests-common.sh
+
+inherit eapi7-ver
+
+cutting() {
+	local x
+	for x in {1..1000}; do
+		version_cut 1-2 1.2.3
+		version_cut 2- 1.2.3
+		version_cut 1- 1.2.3
+		version_cut 3-4 1.2.3b_alpha4
+		version_cut 5 1.2.3b_alpha4
+		version_cut 1-2 .1.2.3
+		version_cut 0-2 .1.2.3
+		version_cut 2-3 1.2.3.
+		version_cut 2- 1.2.3.
+		version_cut 2-4 1.2.3.
+	done >/dev/null
+}
+
+replacing() {
+	local x
+	for x in {1..1000}; do
+		version_rs 2 - 1.2.3
+		version_rs 2 . 1.2-3
+		version_rs 3 . 1.2.3a
+		version_rs 2-3 - 1.2_alpha4
+		version_rs 3 - 2 "" 1.2.3b_alpha4
+		version_rs 3-5 _ 4-6 - a1b2c3d4e5
+		version_rs 1 - .1.2.3
+		version_rs 0 - .1.2.3
+		version_rs 3 . 1.2.3
+	done >/dev/null
+}
+
+get_times() {
+	echo "${*}"
+	local real=()
+	local user=()
+
+	for x in {1..5}; do
+		while read tt tv; do
+			case ${tt} in
+				real) real+=( ${tv} );;
+				user) user+=( ${tv} );;
+			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\n' \
+			"${v}" "${!vr}" "${sum}"
+	done
+}
+
+export LC_ALL=C
+
+get_times cutting
+get_times replacing


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] repo/gentoo:eapi7-ver commit in: eclass/tests/
@ 2017-09-06 15:00 Michał Górny
  0 siblings, 0 replies; 7+ messages in thread
From: Michał Górny @ 2017-09-06 15:00 UTC (permalink / raw
  To: gentoo-commits

commit:     d8e37d14f3547237fcb67fe3dd79a7b22f67ebd7
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Sep  6 14:53:53 2017 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Sep  6 14:53:53 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d8e37d14

eapi7-ver.eclass: Add more test cases

 eclass/tests/eapi7-ver.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/eclass/tests/eapi7-ver.sh b/eclass/tests/eapi7-ver.sh
index 4a1315e42f3..a7fd55e374d 100755
--- a/eclass/tests/eapi7-ver.sh
+++ b/eclass/tests/eapi7-ver.sh
@@ -33,11 +33,17 @@ teq 1.2 version_cut 1-2 .1.2.3
 teq .1.2 version_cut 0-2 .1.2.3
 teq 2.3 version_cut 2-3 1.2.3.
 teq 2.3. version_cut 2- 1.2.3.
+teq 2.3. version_cut 2-4 1.2.3.
 
+teq 1.2-3 version_rs 2 - 1.2.3
+teq 1.2.3 version_rs 2 . 1.2-3
+teq 1.2.3.a version_rs 3 . 1.2.3a
+teq 1.2-alpha-4 version_rs 2-3 - 1.2_alpha4
 teq 1.23-b_alpha4 version_rs 3 - 2 "" 1.2.3b_alpha4
 teq a1b_2-c-3-d4e5 version_rs 3-5 _ 4-6 - a1b2c3d4e5
 teq .1-2.3 version_rs 1 - .1.2.3
 teq -1.2.3 version_rs 0 - .1.2.3
+teq 1.2.3. version_rs 3 . 1.2.3
 
 txf version_cut foo 1.2.3
 txf version_rs -3 _ a1b2c3d4e5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] repo/gentoo:eapi7-ver commit in: eclass/tests/
@ 2017-09-08 11:11 Michał Górny
  0 siblings, 0 replies; 7+ messages in thread
From: Michał Górny @ 2017-09-08 11:11 UTC (permalink / raw
  To: gentoo-commits

commit:     c9ee2e478f60420147a7c770585fc883aaf49141
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Sep  8 11:11:00 2017 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Sep  8 11:11:00 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c9ee2e47

eapi7-ver.eclass: Update func names in tests

 eclass/tests/eapi7-ver.sh           | 70 ++++++++++++++++++-------------------
 eclass/tests/eapi7-ver:benchmark.sh | 44 +++++++++++------------
 2 files changed, 57 insertions(+), 57 deletions(-)

diff --git a/eclass/tests/eapi7-ver.sh b/eclass/tests/eapi7-ver.sh
index 0f39f483b90..8a96e4d29b1 100755
--- a/eclass/tests/eapi7-ver.sh
+++ b/eclass/tests/eapi7-ver.sh
@@ -24,42 +24,42 @@ txf() {
 	tend ${?} "function did not die"
 }
 
-teq 1 version_cut 1 1.2.3
-teq 1 version_cut 1-1 1.2.3
-teq 1.2 version_cut 1-2 1.2.3
-teq 2.3 version_cut 2- 1.2.3
-teq 1.2.3 version_cut 1- 1.2.3
-teq 3b version_cut 3-4 1.2.3b_alpha4
-teq alpha version_cut 5 1.2.3b_alpha4
-teq 1.2 version_cut 1-2 .1.2.3
-teq .1.2 version_cut 0-2 .1.2.3
-teq 2.3 version_cut 2-3 1.2.3.
-teq 2.3. version_cut 2- 1.2.3.
-teq 2.3. version_cut 2-4 1.2.3.
+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 version_rs 1 - 1.2.3
-teq 1.2-3 version_rs 2 - 1.2.3
-teq 1-2-3.4 version_rs 1-2 - 1.2.3.4
-teq 1.2-3-4 version_rs 2- - 1.2.3.4
-teq 1.2.3 version_rs 2 . 1.2-3
-teq 1.2.3.a version_rs 3 . 1.2.3a
-teq 1.2-alpha-4 version_rs 2-3 - 1.2_alpha4
-teq 1.23-b_alpha4 version_rs 3 - 2 "" 1.2.3b_alpha4
-teq a1b_2-c-3-d4e5 version_rs 3-5 _ 4-6 - a1b2c3d4e5
-teq .1-2.3 version_rs 1 - .1.2.3
-teq -1.2.3 version_rs 0 - .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 version_cut 0-2 1.2.3
-teq 2.3 version_cut 2-5 1.2.3
-teq "" version_cut 4 1.2.3
-teq "" version_cut 0 1.2.3
-teq "" version_cut 4- 1.2.3
-teq 1.2.3 version_rs 0 - 1.2.3
-teq 1.2.3 version_rs 3 . 1.2.3
-teq 1.2.3 version_rs 3- . 1.2.3
-teq 1.2.3 version_rs 3-5 . 1.2.3
+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 version_cut foo 1.2.3
-txf version_rs -3 _ a1b2c3d4e5
-txf version_rs 5-3 _ a1b2c3d4e5
+txf ver_cut foo 1.2.3
+txf ver_rs -3 _ a1b2c3d4e5
+txf ver_rs 5-3 _ a1b2c3d4e5

diff --git a/eclass/tests/eapi7-ver:benchmark.sh b/eclass/tests/eapi7-ver:benchmark.sh
index 7adcf91cd7d..4b262ab6acc 100755
--- a/eclass/tests/eapi7-ver:benchmark.sh
+++ b/eclass/tests/eapi7-ver:benchmark.sh
@@ -11,34 +11,34 @@ inherit eapi7-ver
 cutting() {
 	local x
 	for x in {1..1000}; do
-		version_cut 1 1.2.3
-		version_cut 1-2 1.2.3
-		version_cut 2- 1.2.3
-		version_cut 1- 1.2.3
-		version_cut 3-4 1.2.3b_alpha4
-		version_cut 5 1.2.3b_alpha4
-		version_cut 1-2 .1.2.3
-		version_cut 0-2 .1.2.3
-		version_cut 2-3 1.2.3.
-		version_cut 2- 1.2.3.
-		version_cut 2-4 1.2.3.
+		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
 }
 
 replacing() {
 	local x
 	for x in {1..1000}; do
-		version_rs 1 - 1.2.3
-		version_rs 2 - 1.2.3
-		version_rs 1-2 - 1.2.3.4
-		version_rs 2- - 1.2.3.4
-		version_rs 2 . 1.2-3
-		version_rs 3 . 1.2.3a
-		version_rs 2-3 - 1.2_alpha4
-		version_rs 3 - 2 "" 1.2.3b_alpha4
-		version_rs 3-5 _ 4-6 - a1b2c3d4e5
-		version_rs 1 - .1.2.3
-		version_rs 0 - .1.2.3
+		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
 }
 


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] repo/gentoo:eapi7-ver commit in: eclass/tests/
@ 2017-09-21  7:04 Michał Górny
  0 siblings, 0 replies; 7+ messages in thread
From: Michał Górny @ 2017-09-21  7:04 UTC (permalink / raw
  To: gentoo-commits

commit:     607399995e0c735688d754a78011abe9327ad50e
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 21 06:35:46 2017 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Sep 21 07:04:28 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=60739999

eapi7-ver.eclass: Benchmark comparison more accurately

 eclass/tests/eapi7-ver_benchmark.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/tests/eapi7-ver_benchmark.sh b/eclass/tests/eapi7-ver_benchmark.sh
index 4f2fecd7f20..b1e3ccb78ae 100755
--- a/eclass/tests/eapi7-ver_benchmark.sh
+++ b/eclass/tests/eapi7-ver_benchmark.sh
@@ -78,7 +78,7 @@ replacing_versionator() {
 
 comparing() {
 	local x
-	for x in {1..200}; do
+	for x in {1..500}; do
 		ver_test 1b_p1 -le 1_p1
 		ver_test 1.1b -le 1.1
 		ver_test 12.2.5 -le 12.2b
@@ -143,5 +143,5 @@ get_times 1 cutting
 get_times 10 cutting_versionator
 get_times 1 replacing
 get_times 10 replacing_versionator
-get_times 5 comparing
+get_times 2 comparing
 get_times 10 comparing_versionator


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] repo/gentoo:eapi7-ver commit in: eclass/tests/
@ 2017-09-22  7:20 Ulrich Müller
  0 siblings, 0 replies; 7+ messages in thread
From: Ulrich Müller @ 2017-09-22  7:20 UTC (permalink / raw
  To: gentoo-commits

commit:     4bf19a3f8a771303292a5dc40c61827fb582b2b2
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 22 07:19:06 2017 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Fri Sep 22 07:19:19 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4bf19a3f

eclass/tests/eapi7-ver.sh: More tests.

 eclass/tests/eapi7-ver.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/eclass/tests/eapi7-ver.sh b/eclass/tests/eapi7-ver.sh
index 144bb2bddc3..7f0ae880767 100755
--- a/eclass/tests/eapi7-ver.sh
+++ b/eclass/tests/eapi7-ver.sh
@@ -149,6 +149,10 @@ 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 2147483648 # 2**31
+teqr 0 ver_test 0 -lt 4294967296 # 2**32
+teqr 0 ver_test 0 -lt 576460752303423488 # 2**59
+#teqr 0 ver_test 0 -lt 9223372036854775808 # 2**63 fails, integer rollover
 
 # Bad number or ordering of arguments
 txf ver_test 1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] repo/gentoo:eapi7-ver commit in: eclass/tests/
@ 2017-09-24 15:43 Ulrich Müller
  0 siblings, 0 replies; 7+ messages in thread
From: Ulrich Müller @ 2017-09-24 15:43 UTC (permalink / raw
  To: gentoo-commits

commit:     cd499c8434c2c2951a01def56239faa9937fe2f2
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 24 12:25:25 2017 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sun Sep 24 12:25:25 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cd499c84

eclass/tests/eapi7-ver.sh: Fixup: Remove two redundant tests, add texit.

 eclass/tests/eapi7-ver.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/eclass/tests/eapi7-ver.sh b/eclass/tests/eapi7-ver.sh
index 1bd0bd1d81a..d4aa4fdbd28 100755
--- a/eclass/tests/eapi7-ver.sh
+++ b/eclass/tests/eapi7-ver.sh
@@ -149,8 +149,6 @@ 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 2147483648 # 2**31
-teqr 0 ver_test 0 -lt 4294967296 # 2**32
 teqr 0 ver_test 0 -lt 576460752303423488 # 2**59
 teqr 0 ver_test 0 -lt 9223372036854775808 # 2**63
 
@@ -174,3 +172,6 @@ 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] 7+ messages in thread

end of thread, other threads:[~2017-09-24 15:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-24 15:43 [gentoo-commits] repo/gentoo:eapi7-ver commit in: eclass/tests/ Ulrich Müller
  -- strict thread matches above, loose matches on Subject: below --
2017-09-22  7:20 Ulrich Müller
2017-09-21  7:04 Michał Górny
2017-09-08 11:11 Michał Górny
2017-09-06 15:00 Michał Górny
2017-09-06 15:00 Michał Górny
2017-09-06 13:48 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