From: Nikos Mavrogiannopoulos Date: Fri, 11 Nov 2011 22:08:51 +0000 (+0100) Subject: slow tests are not being run using valgrind X-Git-Tag: gnutls_3_0_8~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=971dcd3e4a9ec2dea780f1e9987eaf0d6f57eba3;p=thirdparty%2Fgnutls.git slow tests are not being run using valgrind --- diff --git a/tests/Makefile.am b/tests/Makefile.am index 00d17be95d..2cb4fd170c 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -20,7 +20,8 @@ # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. SUBDIRS = . rsa-md5-collision pkcs1-padding pkcs8-decode pkcs12-decode \ - userid pathlen key-id sha2 safe-renegotiation dsa scripts ecdsa + userid pathlen key-id sha2 safe-renegotiation dsa scripts ecdsa \ + slow if ENABLE_OPENPGP SUBDIRS += openpgp-certs @@ -64,8 +65,7 @@ ctests = mini-deflate simple gc set_pkcs12_cred certder certuniqueid \ crq_apis init_roundtrip pkcs12_s2k_pem dn2 mini-eagain \ nul-in-x509-names x509_altname pkcs12_encode mini-x509 \ mini-x509-rehandshake rng-fork mini-eagain-dtls cipher-test \ - x509cert x509cert-tl infoaccess keygen #gendh -#gendh is out because it is too slow in valgrind + x509cert x509cert-tl infoaccess if ENABLE_OPENSSL ctests += openssl diff --git a/tests/slow/Makefile.am b/tests/slow/Makefile.am new file mode 100644 index 0000000000..fda6f33eb8 --- /dev/null +++ b/tests/slow/Makefile.am @@ -0,0 +1,35 @@ +## Process this file with automake to produce Makefile.in +# Copyright (C) 2010 Free Software Foundation, Inc. +# +# This file is part of GnuTLS. +# +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This file is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this file; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS) +AM_CPPFLAGS = \ + -I$(top_srcdir)/lib/includes \ + -I$(top_builddir)/lib/includes \ + -I$(top_srcdir)/tests/ + +AM_LDFLAGS = -no-install +LDADD = ../libutils.la \ + ../../lib/libgnutls.la $(LTLIBGCRYPT) $(LIBSOCKET) + +ctests = gendh keygen + +check_PROGRAMS = $(ctests) +TESTS = $(ctests) + +EXTRA_DIST = README diff --git a/tests/slow/README b/tests/slow/README new file mode 100644 index 0000000000..0f1982c725 --- /dev/null +++ b/tests/slow/README @@ -0,0 +1 @@ +Those tests are here because they are very slow when run under valgrind. diff --git a/tests/gendh.c b/tests/slow/gendh.c similarity index 100% rename from tests/gendh.c rename to tests/slow/gendh.c diff --git a/tests/keygen.c b/tests/slow/keygen.c similarity index 93% rename from tests/keygen.c rename to tests/slow/keygen.c index aa6365ed2f..3b95479779 100644 --- a/tests/keygen.c +++ b/tests/slow/keygen.c @@ -33,6 +33,10 @@ #include "utils.h" +#define MAX_TRIES 2 + +static int sec_param[MAX_TRIES] = {GNUTLS_SEC_PARAM_WEAK, GNUTLS_SEC_PARAM_NORMAL}; + static void tls_log_func (int level, const char *str) { @@ -53,7 +57,7 @@ doit (void) if (debug) gnutls_global_set_log_level (4711); - for (i = 0; i < 2; i++) + for (i = 0; i < MAX_TRIES; i++) { for (algorithm = GNUTLS_PK_RSA; algorithm <= GNUTLS_PK_ECC; algorithm++) @@ -71,7 +75,7 @@ doit (void) gnutls_x509_privkey_generate (pkey, algorithm, gnutls_sec_param_to_pk_bits (algorithm, - GNUTLS_SEC_PARAM_NORMAL), + sec_param[i]), 0); if (ret < 0) {