diff options
-rw-r--r-- | tests/scripts/common.sh | 12 | ||||
-rw-r--r-- | tests/slow/Makefile.am | 4 | ||||
-rw-r--r-- | tests/slow/test-ciphers-common.sh | 6 | ||||
-rwxr-xr-x | tests/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 |