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@gentoo.org>
This commit is contained in:
Ulrich Müller
2024-06-12 17:28:23 +02:00
parent 590acbe141
commit dfbc5ab206
3 changed files with 6 additions and 6 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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