summaryrefslogtreecommitdiff
path: root/tests/slow/test-hash-large.sh
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@gnu.org>2020-09-24 11:48:24 +0200
committerDaiki Ueno <ueno@gnu.org>2020-10-03 14:47:29 +0200
commit54e52b9a396ccff30758a06c9b5f30241876d48b (patch)
tree624e0f627825964ace87b14bed2bce5e01c5e978 /tests/slow/test-hash-large.sh
parent3e83c0c4bf904bc4250a946e9aae051ed731e640 (diff)
downloadgnutls-54e52b9a396ccff30758a06c9b5f30241876d48b.tar.gz
tests: simplify program detection
Signed-off-by: Daiki Ueno <ueno@gnu.org>
Diffstat (limited to 'tests/slow/test-hash-large.sh')
-rwxr-xr-xtests/slow/test-hash-large.sh18
1 files changed, 7 insertions, 11 deletions
diff --git a/tests/slow/test-hash-large.sh b/tests/slow/test-hash-large.sh
index 359a15ff72..7a052bddcd 100755
--- a/tests/slow/test-hash-large.sh
+++ b/tests/slow/test-hash-large.sh
@@ -44,23 +44,19 @@ run_test() {
#0x1: no optimizations
#"": default optimizations
-SSSE3FLAG=""
-SHANIFLAG=""
-which lscpu >/dev/null 2>&1
-if test $? = 0;then
- $(which lscpu)|grep Architecture|grep x86 >/dev/null
- if test $? = 0;then
- SSSE3FLAG="0x4"
+FLAGS=""
+if (lscpu --version) >/dev/null 2>&1; then
+ if lscpu 2>/dev/null | grep 'Flags:[ ]*ssse3' >/dev/null; then
+ FLAGS="$FLAGS 0x4"
fi
- $(which lscpu)|grep Flags|grep sha_ni >/dev/null
- if test $? = 0;then
- SHANIFLAG="0x20"
+ if lscpu 2>/dev/null | grep 'Flags:[ ]*sha_ni' >/dev/null; then
+ FLAGS="$FLAGS 0x20"
fi
fi
WAITPID=""
-for flags in "" "0x1" ${SSSE3FLAG} ${SHANIFLAG};do
+for flags in "" "0x1" ${FLAGS};do
run_test ${flags} &
WAITPID="${WAITPID} $!"
done