[git] GCRYPT - branch, master, updated. libgcrypt-1.5.0-424-g2e5354f

by Werner Koch cvs at cvs.gnupg.org
Mon Dec 9 09:10:13 CET 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU crypto library".

The branch, master has been updated
       via  2e5354fe8db5288939733d0fb63ad4c87bc20105 (commit)
      from  8072e9fa4b42ae8e65e266aa158fd903f1bb0927 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 2e5354fe8db5288939733d0fb63ad4c87bc20105
Author: Werner Koch <wk at gnupg.org>
Date:   Tue Oct 22 14:26:53 2013 +0200

    tests: Speed up benchmarks in regression test mode.
    
    * tests/tsexp.c (check_extract_param): Fix compiler warning.
    * tests/Makefile.am (TESTS_ENVIRONMENT): Set GCRYPT_IN_REGRESSION_TEST.
    * tests/bench-slope.c (main): Speed up if in regression test mode.
    * tests/benchmark.c (main): Ditto.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 87283f9..3fb9fd6 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -23,10 +23,11 @@ TESTS = version mpitests tsexp t-convert \
 	prime basic keygen pubkey hmac hashtest t-kdf keygrip \
 	fips186-dsa aeswrap pkcs1v2 random dsa-rfc6979 t-ed25519
 
-
 # The last tests to run.
 TESTS += benchmark bench-slope
 
+TESTS_ENVIRONMENT = GCRYPT_IN_REGRESSION_TEST=1
+
 
 # Need to include ../src in addition to top_srcdir because gcrypt.h is
 # a built header.
diff --git a/tests/bench-slope.c b/tests/bench-slope.c
index 79314c3..219e0dd 100644
--- a/tests/bench-slope.c
+++ b/tests/bench-slope.c
@@ -48,6 +48,9 @@ static int num_measurement_repetitions;
    results.  */
 static double cpu_ghz = -1;
 
+/* Whether we are running as part of the regression test suite.  */
+static int in_regression_test;
+
 /* The name of the currently printed section.  */
 static char *current_section_name;
 /* The name of the currently printed algorithm.  */
@@ -1453,8 +1456,6 @@ main (int argc, char **argv)
   int last_argc = -1;
   int debug = 0;
 
-  num_measurement_repetitions = NUM_MEASUREMENT_REPETITIONS;
-
   if (argc)
     {
       argc--;
@@ -1466,6 +1467,14 @@ main (int argc, char **argv)
   if (!argc && getenv ("srcdir") && getenv ("GCRYPT_NO_BENCHMARKS"))
     exit (77);
 
+  if (getenv ("GCRYPT_IN_REGRESSION_TEST"))
+    {
+      in_regression_test = 1;
+      num_measurement_repetitions = 2;
+    }
+  else
+    num_measurement_repetitions = NUM_MEASUREMENT_REPETITIONS;
+
   while (argc && last_argc != argc)
     {
       last_argc = argc;
@@ -1565,6 +1574,9 @@ main (int argc, char **argv)
   gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
   gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
 
+  if (in_regression_test)
+    fputs ("Note: " PGM " running in quick regression test mode.\n", stdout);
+
   if (!argc)
     {
       warm_up_cpu ();
diff --git a/tests/benchmark.c b/tests/benchmark.c
index 3f44e33..62dfc22 100644
--- a/tests/benchmark.c
+++ b/tests/benchmark.c
@@ -59,6 +59,9 @@ static int cipher_with_keysetup;
 /* Whether fips mode was active at startup.  */
 static int in_fips_mode;
 
+/* Whether we are running as part of the regression test suite.  */
+static int in_regression_test;
+
 
 static const char sample_private_dsa_key_1024[] =
 "(private-key\n"
@@ -266,6 +269,7 @@ die (const char *format, ...)
   exit (1);
 }
 
+
 static void
 show_sexp (const char *prefix, gcry_sexp_t a)
 {
@@ -1301,6 +1305,12 @@ main( int argc, char **argv )
   if (!argc && getenv ("srcdir") && getenv ("GCRYPT_NO_BENCHMARKS"))
     exit (77);
 
+  if (getenv ("GCRYPT_IN_REGRESSION_TEST"))
+    {
+      in_regression_test = 1;
+      pk_count = 10;
+    }
+
   while (argc && last_argc != argc )
     {
       last_argc = argc;
@@ -1473,6 +1483,9 @@ main( int argc, char **argv )
   if (mac_repetitions < 1)
     mac_repetitions = 1;
 
+  if (in_regression_test)
+    fputs ("Note: " PGM " running in quick regression test mode.\n", stdout);
+
   if ( !argc )
     {
       gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
diff --git a/tests/tsexp.c b/tests/tsexp.c
index 2f6ad8f..1ab9802 100644
--- a/tests/tsexp.c
+++ b/tests/tsexp.c
@@ -1022,7 +1022,8 @@ check_extract_param (void)
     {
       fail ("gcry_sexp_extract_param long name failed: curve mismatch");
       gcry_log_debug ("expected: %s\n", "Ed25519");
-      gcry_log_debug ("     got: %.*s\n", (int)ioarray[0].len, ioarray[0].data);
+      gcry_log_debug ("     got: %.*s\n",
+                      (int)ioarray[0].len, (char*)ioarray[0].data);
     }
 
   if (!mpis[0])

-----------------------------------------------------------------------

Summary of changes:
 tests/Makefile.am   |    3 ++-
 tests/bench-slope.c |   16 ++++++++++++++--
 tests/benchmark.c   |   13 +++++++++++++
 tests/tsexp.c       |    3 ++-
 4 files changed, 31 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
The GNU crypto library
http://git.gnupg.org


_______________________________________________
Gnupg-commits mailing list
Gnupg-commits at gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-commits




More information about the Gcrypt-devel mailing list