summaryrefslogtreecommitdiff
path: root/tests/benchmark.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2013-10-22 14:26:53 +0200
committerWerner Koch <wk@gnupg.org>2013-12-09 09:07:42 +0100
commit2e5354fe8db5288939733d0fb63ad4c87bc20105 (patch)
tree8a641383500fc82cf52bd24b1e1e99a1f3dd502f /tests/benchmark.c
parent8072e9fa4b42ae8e65e266aa158fd903f1bb0927 (diff)
downloadlibgcrypt-2e5354fe8db5288939733d0fb63ad4c87bc20105.tar.gz
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@gnupg.org>
Diffstat (limited to 'tests/benchmark.c')
-rw-r--r--tests/benchmark.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/benchmark.c b/tests/benchmark.c
index 3f44e338..62dfc220 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);