summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2017-05-26 12:43:21 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2017-05-26 12:52:49 +0200
commitf406f683e9841ae8cc80f65e822334c1494faba5 (patch)
treee4496c1b912264d771eb91e33b59470b80bd855b
parent92179bf1e3e920170031d4d0d17ee39d91801618 (diff)
downloadgnutls-tmp-reduce-cycles-in-non-x86.tar.gz
tests: skip x86-specific tests when not in x86tmp-reduce-cycles-in-non-x86
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
-rw-r--r--tests/scripts/common.sh12
-rw-r--r--tests/slow/Makefile.am4
-rw-r--r--tests/slow/test-ciphers-common.sh6
-rwxr-xr-xtests/slow/test-hash-large.sh (renamed from tests/slow/test-hash-large)5
4 files changed, 25 insertions, 2 deletions
diff --git a/tests/scripts/common.sh b/tests/scripts/common.sh
index 8c0e1e920f..9dae0b47b9 100644
--- a/tests/scripts/common.sh
+++ b/tests/scripts/common.sh
@@ -83,6 +83,18 @@ fail() {
exit 1
}
+exit_if_non_x86()
+{
+which lscpu >/dev/null 2>&1
+if test $? = 0;then
+ $(which lscpu)|grep Architecture|grep x86
+ if test $? != 0;then
+ echo "non-x86 CPU detected"
+ exit 0
+ fi
+fi
+}
+
wait_for_port()
{
local ret
diff --git a/tests/slow/Makefile.am b/tests/slow/Makefile.am
index 8f9c4e4db6..f387a00c7c 100644
--- a/tests/slow/Makefile.am
+++ b/tests/slow/Makefile.am
@@ -47,9 +47,9 @@ mac_override_LDFLAGS = $(NETTLE_LIBS) $(HOGWEED_LIBS) $(GMP_LIBS) $(LDADD)
endif
-dist_check_SCRIPTS = test-ciphers.sh override-ciphers test-hash-large test-ciphers-common.sh
+dist_check_SCRIPTS = test-ciphers.sh override-ciphers test-hash-large.sh test-ciphers-common.sh
check_PROGRAMS = $(ctests) cipher-test cipher-override mac-override cipher-override2 hash-large crypto
-TESTS = $(ctests) test-ciphers.sh override-ciphers test-hash-large crypto
+TESTS = $(ctests) test-ciphers.sh override-ciphers test-hash-large.sh crypto
if HAVE_LIBCRYPTO
cipher_openssl_compat_LDFLAGS = $(LDADD) $(LIBCRYPTO)
diff --git a/tests/slow/test-ciphers-common.sh b/tests/slow/test-ciphers-common.sh
index cb415a35bc..52d9d50ea9 100644
--- a/tests/slow/test-ciphers-common.sh
+++ b/tests/slow/test-ciphers-common.sh
@@ -23,6 +23,9 @@ if ! test -z "${VALGRIND}"; then
VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND}"
fi
+srcdir="${srcdir:-.}"
+. "${srcdir}/../scripts/common.sh"
+
${PROG}
ret=$?
if test $ret != 0; then
@@ -30,6 +33,7 @@ if test $ret != 0; then
exit $ret
fi
+# All optimizations disabled
GNUTLS_CPUID_OVERRIDE=0x1 ${PROG}
ret=$?
if test $ret != 0; then
@@ -37,6 +41,8 @@ if test $ret != 0; then
exit $ret
fi
+exit_if_non_x86
+
GNUTLS_CPUID_OVERRIDE=0x2 ${PROG}
ret=$?
if test $ret != 0; then
diff --git a/tests/slow/test-hash-large b/tests/slow/test-hash-large.sh
index e09579a00c..74350b6686 100755
--- a/tests/slow/test-hash-large
+++ b/tests/slow/test-hash-large.sh
@@ -26,6 +26,9 @@ if ! test -z "${VALGRIND}"; then
VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND}"
fi
+srcdir="${srcdir:-.}"
+. "${srcdir}/../scripts/common.sh"
+
${PROG}
ret=$?
if test $ret != 0; then
@@ -40,6 +43,8 @@ if test $ret != 0; then
exit $ret
fi
+exit_if_non_x86
+
GNUTLS_CPUID_OVERRIDE=0x4 ${PROG}
ret=$?
if test $ret != 0; then