diff options
| author | Brent Cook <bcook@openbsd.org> | 2015-03-21 19:04:54 -0500 |
|---|---|---|
| committer | Brent Cook <bcook@openbsd.org> | 2015-03-21 19:04:54 -0500 |
| commit | 45065de1bafde1d34acd2cab1b8460663074961c (patch) | |
| tree | 6a473b5864b1e652a0e45d8a260ed4d5113b79c8 | |
| parent | e38dc152d6b96aa724c6b77f3383bb75787c6f81 (diff) | |
| download | portable-45065de1bafde1d34acd2cab1b8460663074961c.tar.gz portable-45065de1bafde1d34acd2cab1b8460663074961c.tar.bz2 portable-45065de1bafde1d34acd2cab1b8460663074961c.zip | |
rework tests Makefile.am
There are so many test exceptions that need handling that it is easier
to simply edit it directly rather than doing autogeneration anymore.
This also puts biotest and pidwraptest behind a new --enable-extratests
option, so they are easy to run but are not enabled by default.
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | configure.ac | 4 | ||||
| -rw-r--r-- | tests/Makefile.am | 282 | ||||
| -rw-r--r-- | tests/Makefile.am.tpl | 15 | ||||
| -rwxr-xr-x | update.sh | 76 |
5 files changed, 289 insertions, 89 deletions
| @@ -92,7 +92,6 @@ INSTALL | |||
| 92 | /stamp-h2 | 92 | /stamp-h2 |
| 93 | 93 | ||
| 94 | include/openssl/Makefile.am | 94 | include/openssl/Makefile.am |
| 95 | tests/Makefile.am | ||
| 96 | 95 | ||
| 97 | crypto/VERSION | 96 | crypto/VERSION |
| 98 | ssl/VERSION | 97 | ssl/VERSION |
diff --git a/configure.ac b/configure.ac index 6a50c1b..af4b26e 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -287,6 +287,10 @@ AC_ARG_ENABLE([asm], | |||
| 287 | AS_HELP_STRING([--disable-asm], [Disable assembly])) | 287 | AS_HELP_STRING([--disable-asm], [Disable assembly])) |
| 288 | AM_CONDITIONAL([OPENSSL_NO_ASM], [test "x$enable_asm" = "xno"]) | 288 | AM_CONDITIONAL([OPENSSL_NO_ASM], [test "x$enable_asm" = "xno"]) |
| 289 | 289 | ||
| 290 | AC_ARG_ENABLE([extratests], | ||
| 291 | AS_HELP_STRING([--enable-extratests], [Enable extra tests that may be unreliable on some platforms])) | ||
| 292 | AM_CONDITIONAL([ENABLE_EXTRATESTS], [test "x$enable_extratests" = xyes]) | ||
| 293 | |||
| 290 | old_cflags=$CFLAGS | 294 | old_cflags=$CFLAGS |
| 291 | CFLAGS="$old_cflags -I$srcdir/include" | 295 | CFLAGS="$old_cflags -I$srcdir/include" |
| 292 | AC_TRY_COMPILE([#include "$srcdir/crypto/modes/modes_lcl.h"], | 296 | AC_TRY_COMPILE([#include "$srcdir/crypto/modes/modes_lcl.h"], |
diff --git a/tests/Makefile.am b/tests/Makefile.am new file mode 100644 index 0000000..2ed7a44 --- /dev/null +++ b/tests/Makefile.am | |||
| @@ -0,0 +1,282 @@ | |||
| 1 | include $(top_srcdir)/Makefile.am.common | ||
| 2 | |||
| 3 | AM_CPPFLAGS += -I $(top_srcdir)/crypto/modes | ||
| 4 | AM_CPPFLAGS += -I $(top_srcdir)/crypto/asn1 | ||
| 5 | AM_CPPFLAGS += -I $(top_srcdir)/ssl | ||
| 6 | |||
| 7 | LDADD = $(PLATFORM_LDADD) $(PROG_LDADD) | ||
| 8 | LDADD += $(top_builddir)/ssl/libssl.la | ||
| 9 | LDADD += $(top_builddir)/crypto/libcrypto.la | ||
| 10 | |||
| 11 | TESTS = | ||
| 12 | check_PROGRAMS = | ||
| 13 | EXTRA_DIST = | ||
| 14 | DISTCLEANFILES = pidwraptest.txt | ||
| 15 | |||
| 16 | # aeadtest | ||
| 17 | TESTS += aeadtest.sh | ||
| 18 | check_PROGRAMS += aeadtest | ||
| 19 | aeadtest_SOURCES = aeadtest.c | ||
| 20 | EXTRA_DIST += aeadtest.sh | ||
| 21 | EXTRA_DIST += aeadtests.txt | ||
| 22 | |||
| 23 | # aes_wrap | ||
| 24 | TESTS += aes_wrap | ||
| 25 | check_PROGRAMS += aes_wrap | ||
| 26 | aes_wrap_SOURCES = aes_wrap.c | ||
| 27 | |||
| 28 | # arc4randomforktest | ||
| 29 | # Windows/mingw does not have fork, but Cygwin does. | ||
| 30 | if !HOST_WIN | ||
| 31 | TESTS += arc4randomforktest.sh | ||
| 32 | check_PROGRAMS += arc4randomforktest | ||
| 33 | arc4randomforktest_SOURCES = arc4randomforktest.c | ||
| 34 | endif | ||
| 35 | EXTRA_DIST += arc4randomforktest.sh | ||
| 36 | |||
| 37 | # asn1test | ||
| 38 | TESTS += asn1test | ||
| 39 | check_PROGRAMS += asn1test | ||
| 40 | asn1test_SOURCES = asn1test.c | ||
| 41 | |||
| 42 | # base64test | ||
| 43 | TESTS += base64test | ||
| 44 | check_PROGRAMS += base64test | ||
| 45 | base64test_SOURCES = base64test.c | ||
| 46 | |||
| 47 | # bftest | ||
| 48 | TESTS += bftest | ||
| 49 | check_PROGRAMS += bftest | ||
| 50 | bftest_SOURCES = bftest.c | ||
| 51 | |||
| 52 | # biotest | ||
| 53 | # the BIO tests rely on resolver results that are OS and environment-specific | ||
| 54 | if ENABLE_EXTRATESTS | ||
| 55 | TESTS += biotest | ||
| 56 | check_PROGRAMS += biotest | ||
| 57 | biotest_SOURCES = biotest.c | ||
| 58 | endif | ||
| 59 | |||
| 60 | # bntest | ||
| 61 | TESTS += bntest | ||
| 62 | check_PROGRAMS += bntest | ||
| 63 | bntest_SOURCES = bntest.c | ||
| 64 | |||
| 65 | # bytestringtest | ||
| 66 | TESTS += bytestringtest | ||
| 67 | check_PROGRAMS += bytestringtest | ||
| 68 | bytestringtest_SOURCES = bytestringtest.c | ||
| 69 | |||
| 70 | # casttest | ||
| 71 | TESTS += casttest | ||
| 72 | check_PROGRAMS += casttest | ||
| 73 | casttest_SOURCES = casttest.c | ||
| 74 | |||
| 75 | # chachatest | ||
| 76 | TESTS += chachatest | ||
| 77 | check_PROGRAMS += chachatest | ||
| 78 | chachatest_SOURCES = chachatest.c | ||
| 79 | |||
| 80 | # cipherstest | ||
| 81 | TESTS += cipherstest | ||
| 82 | check_PROGRAMS += cipherstest | ||
| 83 | cipherstest_SOURCES = cipherstest.c | ||
| 84 | |||
| 85 | # cts128test | ||
| 86 | TESTS += cts128test | ||
| 87 | check_PROGRAMS += cts128test | ||
| 88 | cts128test_SOURCES = cts128test.c | ||
| 89 | |||
| 90 | # destest | ||
| 91 | TESTS += destest | ||
| 92 | check_PROGRAMS += destest | ||
| 93 | destest_SOURCES = destest.c | ||
| 94 | |||
| 95 | # dhtest | ||
| 96 | TESTS += dhtest | ||
| 97 | check_PROGRAMS += dhtest | ||
| 98 | dhtest_SOURCES = dhtest.c | ||
| 99 | |||
| 100 | # dsatest | ||
| 101 | TESTS += dsatest | ||
| 102 | check_PROGRAMS += dsatest | ||
| 103 | dsatest_SOURCES = dsatest.c | ||
| 104 | |||
| 105 | # ecdhtest | ||
| 106 | TESTS += ecdhtest | ||
| 107 | check_PROGRAMS += ecdhtest | ||
| 108 | ecdhtest_SOURCES = ecdhtest.c | ||
| 109 | |||
| 110 | # ecdsatest | ||
| 111 | TESTS += ecdsatest | ||
| 112 | check_PROGRAMS += ecdsatest | ||
| 113 | ecdsatest_SOURCES = ecdsatest.c | ||
| 114 | |||
| 115 | # ectest | ||
| 116 | TESTS += ectest | ||
| 117 | check_PROGRAMS += ectest | ||
| 118 | ectest_SOURCES = ectest.c | ||
| 119 | |||
| 120 | # enginetest | ||
| 121 | TESTS += enginetest | ||
| 122 | check_PROGRAMS += enginetest | ||
| 123 | enginetest_SOURCES = enginetest.c | ||
| 124 | |||
| 125 | # evptest | ||
| 126 | TESTS += evptest.sh | ||
| 127 | check_PROGRAMS += evptest | ||
| 128 | evptest_SOURCES = evptest.c | ||
| 129 | EXTRA_DIST += evptest.sh | ||
| 130 | EXTRA_DIST += evptests.txt | ||
| 131 | |||
| 132 | # explicit_bzero | ||
| 133 | # explicit_bzero relies on SA_ONSTACK, which is unavailable on Windows | ||
| 134 | if !HOST_WIN | ||
| 135 | if !HOST_CYGWIN | ||
| 136 | TESTS += explicit_bzero | ||
| 137 | check_PROGRAMS += explicit_bzero | ||
| 138 | explicit_bzero_SOURCES = explicit_bzero.c | ||
| 139 | if !HAVE_MEMMEM | ||
| 140 | explicit_bzero_SOURCES += memmem.c | ||
| 141 | endif | ||
| 142 | endif | ||
| 143 | endif | ||
| 144 | |||
| 145 | # exptest | ||
| 146 | TESTS += exptest | ||
| 147 | check_PROGRAMS += exptest | ||
| 148 | exptest_SOURCES = exptest.c | ||
| 149 | |||
| 150 | # gcm128test | ||
| 151 | TESTS += gcm128test | ||
| 152 | check_PROGRAMS += gcm128test | ||
| 153 | gcm128test_SOURCES = gcm128test.c | ||
| 154 | |||
| 155 | # gost2814789t | ||
| 156 | TESTS += gost2814789t | ||
| 157 | check_PROGRAMS += gost2814789t | ||
| 158 | gost2814789t_SOURCES = gost2814789t.c | ||
| 159 | |||
| 160 | # hmactest | ||
| 161 | TESTS += hmactest | ||
| 162 | check_PROGRAMS += hmactest | ||
| 163 | hmactest_SOURCES = hmactest.c | ||
| 164 | |||
| 165 | # ideatest | ||
| 166 | TESTS += ideatest | ||
| 167 | check_PROGRAMS += ideatest | ||
| 168 | ideatest_SOURCES = ideatest.c | ||
| 169 | |||
| 170 | # igetest | ||
| 171 | TESTS += igetest | ||
| 172 | check_PROGRAMS += igetest | ||
| 173 | igetest_SOURCES = igetest.c | ||
| 174 | |||
| 175 | # md4test | ||
| 176 | TESTS += md4test | ||
| 177 | check_PROGRAMS += md4test | ||
| 178 | md4test_SOURCES = md4test.c | ||
| 179 | |||
| 180 | # md5test | ||
| 181 | TESTS += md5test | ||
| 182 | check_PROGRAMS += md5test | ||
| 183 | md5test_SOURCES = md5test.c | ||
| 184 | |||
| 185 | # mdc2test | ||
| 186 | TESTS += mdc2test | ||
| 187 | check_PROGRAMS += mdc2test | ||
| 188 | mdc2test_SOURCES = mdc2test.c | ||
| 189 | |||
| 190 | # mont | ||
| 191 | TESTS += mont | ||
| 192 | check_PROGRAMS += mont | ||
| 193 | mont_SOURCES = mont.c | ||
| 194 | |||
| 195 | # pbkdf2 | ||
| 196 | TESTS += pbkdf2 | ||
| 197 | check_PROGRAMS += pbkdf2 | ||
| 198 | pbkdf2_SOURCES = pbkdf2.c | ||
| 199 | |||
| 200 | # pidwraptest | ||
| 201 | # pidwraptest relies on an OS-specific way to give out pids and is generally | ||
| 202 | # awkward on systems with slow fork | ||
| 203 | if ENABLE_EXTRATESTS | ||
| 204 | TESTS += pidwraptest | ||
| 205 | check_PROGRAMS += pidwraptest | ||
| 206 | pidwraptest_SOURCES = pidwraptest.c | ||
| 207 | endif | ||
| 208 | |||
| 209 | # pkcs7test | ||
| 210 | TESTS += pkcs7test | ||
| 211 | check_PROGRAMS += pkcs7test | ||
| 212 | pkcs7test_SOURCES = pkcs7test.c | ||
| 213 | |||
| 214 | # poly1305test | ||
| 215 | TESTS += poly1305test | ||
| 216 | check_PROGRAMS += poly1305test | ||
| 217 | poly1305test_SOURCES = poly1305test.c | ||
| 218 | |||
| 219 | # pq_test | ||
| 220 | TESTS += pq_test.sh | ||
| 221 | check_PROGRAMS += pq_test | ||
| 222 | pq_test_SOURCES = pq_test.c | ||
| 223 | EXTRA_DIST += pq_test.sh | ||
| 224 | EXTRA_DIST += pq_expected.txt | ||
| 225 | |||
| 226 | # randtest | ||
| 227 | TESTS += randtest | ||
| 228 | check_PROGRAMS += randtest | ||
| 229 | randtest_SOURCES = randtest.c | ||
| 230 | |||
| 231 | # rc2test | ||
| 232 | TESTS += rc2test | ||
| 233 | check_PROGRAMS += rc2test | ||
| 234 | rc2test_SOURCES = rc2test.c | ||
| 235 | |||
| 236 | # rc4test | ||
| 237 | TESTS += rc4test | ||
| 238 | check_PROGRAMS += rc4test | ||
| 239 | rc4test_SOURCES = rc4test.c | ||
| 240 | |||
| 241 | # rmdtest | ||
| 242 | TESTS += rmdtest | ||
| 243 | check_PROGRAMS += rmdtest | ||
| 244 | rmdtest_SOURCES = rmdtest.c | ||
| 245 | |||
| 246 | # sha1test | ||
| 247 | TESTS += sha1test | ||
| 248 | check_PROGRAMS += sha1test | ||
| 249 | sha1test_SOURCES = sha1test.c | ||
| 250 | |||
| 251 | # sha256test | ||
| 252 | TESTS += sha256test | ||
| 253 | check_PROGRAMS += sha256test | ||
| 254 | sha256test_SOURCES = sha256test.c | ||
| 255 | |||
| 256 | # sha512test | ||
| 257 | TESTS += sha512test | ||
| 258 | check_PROGRAMS += sha512test | ||
| 259 | sha512test_SOURCES = sha512test.c | ||
| 260 | |||
| 261 | # shatest | ||
| 262 | TESTS += shatest | ||
| 263 | check_PROGRAMS += shatest | ||
| 264 | shatest_SOURCES = shatest.c | ||
| 265 | |||
| 266 | # ssltest | ||
| 267 | TESTS += ssltest.sh | ||
| 268 | check_PROGRAMS += ssltest | ||
| 269 | ssltest_SOURCES = ssltest.c | ||
| 270 | EXTRA_DIST += ssltest.sh | ||
| 271 | EXTRA_DIST += testssl ca.pem server.pem | ||
| 272 | |||
| 273 | # timingsafe | ||
| 274 | TESTS += timingsafe | ||
| 275 | check_PROGRAMS += timingsafe | ||
| 276 | timingsafe_SOURCES = timingsafe.c | ||
| 277 | |||
| 278 | # utf8test | ||
| 279 | TESTS += utf8test | ||
| 280 | check_PROGRAMS += utf8test | ||
| 281 | utf8test_SOURCES = utf8test.c | ||
| 282 | |||
diff --git a/tests/Makefile.am.tpl b/tests/Makefile.am.tpl deleted file mode 100644 index 26334af..0000000 --- a/tests/Makefile.am.tpl +++ /dev/null | |||
| @@ -1,15 +0,0 @@ | |||
| 1 | include $(top_srcdir)/Makefile.am.common | ||
| 2 | |||
| 3 | AM_CPPFLAGS += -I $(top_srcdir)/crypto/modes | ||
| 4 | AM_CPPFLAGS += -I $(top_srcdir)/crypto/asn1 | ||
| 5 | AM_CPPFLAGS += -I $(top_srcdir)/ssl | ||
| 6 | |||
| 7 | LDADD = $(PLATFORM_LDADD) $(PROG_LDADD) | ||
| 8 | LDADD += $(top_builddir)/ssl/libssl.la | ||
| 9 | LDADD += $(top_builddir)/crypto/libcrypto.la | ||
| 10 | |||
| 11 | TESTS = | ||
| 12 | check_PROGRAMS = | ||
| 13 | EXTRA_DIST = | ||
| 14 | DISTCLEANFILES = pidwraptest.txt | ||
| 15 | |||
| @@ -208,82 +208,12 @@ $CP $libssl_regress/ssl/testssl tests | |||
| 208 | for i in `find $libssl_regress -name '*.c'`; do | 208 | for i in `find $libssl_regress -name '*.c'`; do |
| 209 | $CP "$i" tests | 209 | $CP "$i" tests |
| 210 | done | 210 | done |
| 211 | |||
| 211 | $CP $libssl_regress/certs/ca.pem tests | 212 | $CP $libssl_regress/certs/ca.pem tests |
| 212 | $CP $libssl_regress/certs/server.pem tests | 213 | $CP $libssl_regress/certs/server.pem tests |
| 213 | |||
| 214 | # setup test drivers | ||
| 215 | # do not directly run all test programs | ||
| 216 | test_drivers=( | ||
| 217 | aeadtest | ||
| 218 | evptest | ||
| 219 | pq_test | ||
| 220 | ssltest | ||
| 221 | arc4randomforktest | ||
| 222 | pidwraptest | ||
| 223 | ) | ||
| 224 | tests_posix_only=( | ||
| 225 | arc4randomforktest | ||
| 226 | explicit_bzero | ||
| 227 | pidwraptest | ||
| 228 | ) | ||
| 229 | # the BIO tests rely on resolver results that are OS and environment-specific | ||
| 230 | # explicit_bzero relies on SA_ONSTACK, not available on all systems | ||
| 231 | # pidwraptest relies on an OS-specific way to give out pids and is generally | ||
| 232 | # awkward on systems with slow fork | ||
| 233 | tests_disabled=( | ||
| 234 | biotest | ||
| 235 | explicit_bzero | ||
| 236 | pidwraptest | ||
| 237 | ) | ||
| 238 | $CP $libc_src/string/memmem.c tests/ | ||
| 239 | (cd tests | ||
| 240 | $CP Makefile.am.tpl Makefile.am | ||
| 241 | |||
| 242 | for i in `ls -1 *.c|sort|grep -v memmem.c`; do | ||
| 243 | TEST=`echo $i|sed -e "s/\.c//"` | ||
| 244 | if ! [[ ${tests_disabled[*]} =~ "$TEST" ]]; then | ||
| 245 | if [[ ${tests_posix_only[*]} =~ "$TEST" ]]; then | ||
| 246 | echo "if !HOST_WIN" >> Makefile.am | ||
| 247 | fi | ||
| 248 | if ! [[ ${test_drivers[*]} =~ "$TEST" ]]; then | ||
| 249 | echo "TESTS += $TEST" >> Makefile.am | ||
| 250 | fi | ||
| 251 | echo "check_PROGRAMS += $TEST" >> Makefile.am | ||
| 252 | echo "${TEST}_SOURCES = $i" >> Makefile.am | ||
| 253 | if [[ ${TEST} = "explicit_bzero" ]]; then | ||
| 254 | echo "if !HAVE_MEMMEM" >> Makefile.am | ||
| 255 | echo "explicit_bzero_SOURCES += memmem.c" >> Makefile.am | ||
| 256 | echo "endif" >> Makefile.am | ||
| 257 | fi | ||
| 258 | if [[ ${tests_posix_only[*]} =~ "$TEST" ]]; then | ||
| 259 | echo "endif" >> Makefile.am | ||
| 260 | fi | ||
| 261 | fi | ||
| 262 | done | ||
| 263 | ) | ||
| 264 | $CP $libcrypto_regress/evp/evptests.txt tests | ||
| 265 | $CP $libcrypto_regress/aead/aeadtests.txt tests | ||
| 266 | $CP $libcrypto_regress/pqueue/expected.txt tests/pq_expected.txt | ||
| 267 | chmod 755 tests/testssl | 214 | chmod 755 tests/testssl |
| 268 | for i in "${test_drivers[@]}"; do | ||
| 269 | if [ -e tests/${i}.sh ]; then | ||
| 270 | if ! [[ ${tests_disabled[*]} =~ "$i" ]]; then | ||
| 271 | if [[ ${tests_posix_only[*]} =~ "$i" ]]; then | ||
| 272 | echo "if !HOST_WIN" >> tests/Makefile.am | ||
| 273 | fi | ||
| 274 | echo "TESTS += ${i}.sh" >> tests/Makefile.am | ||
| 275 | if [[ ${tests_posix_only[*]} =~ "$i" ]]; then | ||
| 276 | echo "endif" >> tests/Makefile.am | ||
| 277 | fi | ||
| 278 | echo "EXTRA_DIST += ${i}.sh" >> tests/Makefile.am | ||
| 279 | fi | ||
| 280 | fi | ||
| 281 | done | ||
| 282 | echo "EXTRA_DIST += aeadtests.txt" >> tests/Makefile.am | ||
| 283 | echo "EXTRA_DIST += evptests.txt" >> tests/Makefile.am | ||
| 284 | echo "EXTRA_DIST += pq_expected.txt" >> tests/Makefile.am | ||
| 285 | echo "EXTRA_DIST += testssl ca.pem server.pem" >> tests/Makefile.am | ||
| 286 | 215 | ||
| 216 | # add headers | ||
| 287 | (cd include/openssl | 217 | (cd include/openssl |
| 288 | $CP Makefile.am.tpl Makefile.am | 218 | $CP Makefile.am.tpl Makefile.am |
| 289 | for i in `ls -1 *.h|sort`; do | 219 | for i in `ls -1 *.h|sort`; do |
| @@ -291,8 +221,8 @@ echo "EXTRA_DIST += testssl ca.pem server.pem" >> tests/Makefile.am | |||
| 291 | done | 221 | done |
| 292 | ) | 222 | ) |
| 293 | 223 | ||
| 294 | echo "copying manpages" | ||
| 295 | # copy manpages | 224 | # copy manpages |
| 225 | echo "copying manpages" | ||
| 296 | (cd man | 226 | (cd man |
| 297 | $CP Makefile.am.tpl Makefile.am | 227 | $CP Makefile.am.tpl Makefile.am |
| 298 | 228 | ||
