Add configure option --enable-large-data-tests.
authorWerner Koch <wk@gnupg.org>
Mon, 16 Dec 2013 10:43:22 +0000 (11:43 +0100)
committerWerner Koch <wk@gnupg.org>
Mon, 16 Dec 2013 10:49:05 +0000 (11:49 +0100)
* configure.ac: Add option --enable-large-data-tests.
* tests/hashtest-256g.in: New.
* tests/Makefile.am (EXTRA_DIST): Add hashtest-256g.in.
(TESTS): Split up into tests_bin, tests_bin_last, tests_sh, and
tests_sh_last.
(tests_sh_last): Add hashtest-256g
(noinst_PROGRAMS): Add only tests_bin and tests_bin_last.
(bench-slope.log, hashtest-256g.log): New rules to enforce serial run.

Signed-off-by: Werner Koch <wk@gnupg.org>
README
configure.ac
tests/Makefile.am
tests/hashtest-256g.in [new file with mode: 0755]

diff --git a/README b/README
index ff3ce9c..558e008 100644 (file)
--- a/README
+++ b/README
     Here is a list of configure options which are sometimes useful
     for installation.
 
+     --enable-large-data-tests
+                     With this option a "make check" will take really
+                     long due to extra checks for the hash algorithms.
+
      --enable-m-guard
                      Enable the integrated malloc checking code. Please
                      note that this feature does not work on all CPUs
index 9088d02..571e156 100644 (file)
@@ -524,6 +524,16 @@ if test "$use_m_guard" = yes ; then
     AC_DEFINE(M_GUARD,1,[Define to use the (obsolete) malloc guarding feature])
 fi
 
+# Implementation of the --enable-large-data-tests switch.
+AC_MSG_CHECKING([whether to run large data tests])
+AC_ARG_ENABLE(large-data-tests,
+              AC_HELP_STRING([--enable-large-data-tests],
+                 [Enable the real long ruinning large data tests]),
+             large_data_tests=$enableval,large_data_tests=no)
+AC_MSG_RESULT($large_data_tests)
+AC_SUBST(RUN_LARGE_DATA_TESTS, $large_data_tests)
+
+
 # Implementation of the --with-capabilities switch.
 # Check whether we want to use Linux capabilities
 AC_MSG_CHECKING([whether use of capabilities is requested])
@@ -1914,6 +1924,7 @@ src/libgcrypt-config
 src/versioninfo.rc
 tests/Makefile
 ])
+AC_CONFIG_FILES([tests/hashtest-256g], [chmod +x tests/hashtest-256g])
 AC_OUTPUT
 
 
index 3fb9fd6..f5b5b9f 100644 (file)
 
 ## Process this file with automake to produce Makefile.in
 
-TESTS = version mpitests tsexp t-convert \
+tests_bin = \
+        version mpitests tsexp t-convert \
        t-mpi-bit t-mpi-point curves \
        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_bin_last = benchmark bench-slope
+
+tests_sh =
+
+tests_sh_last = hashtest-256g
+
+TESTS = $(tests_bin) $(tests_sh) $(tests_bin_last) $(tests_sh_last)
+
+# Force sequential run of some tests.
+bench-slope.log:    benchmark.log
+hashtest-256g.log:  bench-slope.log
+
 
 TESTS_ENVIRONMENT = GCRYPT_IN_REGRESSION_TEST=1
 
@@ -37,8 +48,8 @@ AM_CFLAGS = $(GPG_ERROR_CFLAGS)
 LDADD = ../src/libgcrypt.la $(DL_LIBS) ../compat/libcompat.la $(GPG_ERROR_LIBS)
 
 EXTRA_PROGRAMS = testapi pkbench
-noinst_PROGRAMS = $(TESTS) fipsdrv rsacvt genhashdata
+noinst_PROGRAMS = $(tests_bin) $(tests_bin_last) fipsdrv rsacvt genhashdata
 
 EXTRA_DIST = README rsa-16k.key cavs_tests.sh cavs_driver.pl \
             pkcs1v2-oaep.h pkcs1v2-pss.h pkcs1v2-v15c.h pkcs1v2-v15s.h \
-            t-ed25519.inp stopwatch.h
+            t-ed25519.inp stopwatch.h hashtest-256g.in
diff --git a/tests/hashtest-256g.in b/tests/hashtest-256g.in
new file mode 100755 (executable)
index 0000000..02ab3f6
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+algos="SHA1 SHA256"
+
+test "@RUN_LARGE_DATA_TESTS@" = yes || exit 77
+echo "      now running 256 GiB tests for $algos - this takes looong"
+exec ./hashtest --gigs 256 $algos