aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrent Cook <busterb@gmail.com>2014-11-20 08:46:02 -0600
committerBrent Cook <bcook@openbsd.org>2014-12-03 17:02:29 -0600
commit96bf8be098b434ec19146d5724b60179ae56e00a (patch)
treed711ef8bff8a7e6f8633dee953cb7565959b3e54
parent58fcd3c39c73d83eb9782a8ef935498b18b5ae73 (diff)
downloadportable-96bf8be098b434ec19146d5724b60179ae56e00a.tar.gz
portable-96bf8be098b434ec19146d5724b60179ae56e00a.tar.bz2
portable-96bf8be098b434ec19146d5724b60179ae56e00a.zip
update and mask unit tests when running on win32
Update pq_test to ignore changes in whitespace. Update for new testssl params, specify absolute paths to test binaries. Fork-based tests do not make sense on Windows. Disable building biotest, since it is too specific to OpenBSD's behavior to be useful on other platforms.
-rwxr-xr-xtests/aeadtest.sh6
-rwxr-xr-xtests/evptest.sh6
-rwxr-xr-xtests/pq_test.sh6
-rwxr-xr-xtests/ssltest.sh20
-rwxr-xr-xupdate.sh30
5 files changed, 57 insertions, 11 deletions
diff --git a/tests/aeadtest.sh b/tests/aeadtest.sh
index d51dd29..132b1fd 100755
--- a/tests/aeadtest.sh
+++ b/tests/aeadtest.sh
@@ -1,3 +1,7 @@
1#!/bin/sh 1#!/bin/sh
2set -e 2set -e
3./aeadtest $srcdir/aeadtests.txt 3TEST=./aeadtest
4if [ -e ./aeadtest.exe ]; then
5 TEST=./aeadtest.exe
6fi
7$TEST $srcdir/aeadtests.txt
diff --git a/tests/evptest.sh b/tests/evptest.sh
index 8e1d106..ba44d75 100755
--- a/tests/evptest.sh
+++ b/tests/evptest.sh
@@ -1,3 +1,7 @@
1#!/bin/sh 1#!/bin/sh
2set -e 2set -e
3./evptest $srcdir/evptests.txt 3TEST=./evptest
4if [ -e ./evptest.exe ]; then
5 TEST=./evptest.exe
6fi
7$TEST $srcdir/evptests.txt
diff --git a/tests/pq_test.sh b/tests/pq_test.sh
index b6b9f5e..ab87bc7 100755
--- a/tests/pq_test.sh
+++ b/tests/pq_test.sh
@@ -1,3 +1,7 @@
1#!/bin/sh 1#!/bin/sh
2set -e 2set -e
3./pq_test | cmp $srcdir/pq_expected.txt - 3TEST=./pq_test
4if [ -e ./pq_test.exe ]; then
5 TEST=./pq_test.exe
6fi
7$TEST | diff -b $srcdir/pq_expected.txt -
diff --git a/tests/ssltest.sh b/tests/ssltest.sh
index 476a258..1b4c9c7 100755
--- a/tests/ssltest.sh
+++ b/tests/ssltest.sh
@@ -1,5 +1,19 @@
1#!/bin/sh 1#!/bin/sh
2set -e 2set -e
3PATH=../apps:$PATH 3
4export PATH 4ssltest_bin=./ssltest
5$srcdir/testssl $srcdir/server.pem $srcdir/server.pem $srcdir/ca.pem 5if [ -e ./ssltest.exe ]; then
6 ssltest_bin=./ssltest.exe
7fi
8
9openssl_bin=../apps/openssl
10if [ -e ../apps/openssl.exe ]; then
11 openssl_bin=../apps/openssl.exe
12fi
13
14if [ -z $srcdir ]; then
15 srcdir=.
16fi
17
18$srcdir/testssl $srcdir/server.pem $srcdir/server.pem $srcdir/ca.pem \
19 $ssltest_bin $openssl_bin
diff --git a/update.sh b/update.sh
index 80842cf..cda2766 100755
--- a/update.sh
+++ b/update.sh
@@ -289,7 +289,7 @@ for i in $openssl_cmd_src/*; do
289done 289done
290 290
291for i in aead/aeadtest.c aeswrap/aes_wrap.c base64/base64test.c bf/bftest.c \ 291for i in aead/aeadtest.c aeswrap/aes_wrap.c base64/base64test.c bf/bftest.c \
292 bio/biotest.c bn/general/bntest.c bn/mont/mont.c \ 292 bn/general/bntest.c bn/mont/mont.c \
293 cast/casttest.c chacha/chachatest.c cts128/cts128test.c \ 293 cast/casttest.c chacha/chachatest.c cts128/cts128test.c \
294 des/destest.c dh/dhtest.c dsa/dsatest.c ec/ectest.c ecdh/ecdhtest.c \ 294 des/destest.c dh/dhtest.c dsa/dsatest.c ec/ectest.c ecdh/ecdhtest.c \
295 ecdsa/ecdsatest.c engine/enginetest.c evp/evptest.c exp/exptest.c \ 295 ecdsa/ecdsatest.c engine/enginetest.c evp/evptest.c exp/exptest.c \
@@ -310,7 +310,6 @@ done
310 310
311# do not directly run all test programs 311# do not directly run all test programs
312test_drivers=( 312test_drivers=(
313 biotest
314 aeadtest 313 aeadtest
315 evptest 314 evptest
316 pq_test 315 pq_test
@@ -322,21 +321,34 @@ test_drivers=(
322tests_disabled=( 321tests_disabled=(
323 biotest 322 biotest
324) 323)
324tests_posix_only=(
325 arc4randomforktest
326 explicit_bzero
327 pidwraptest
328)
325$CP $libc_src/string/memmem.c tests/ 329$CP $libc_src/string/memmem.c tests/
326(cd tests 330(cd tests
327 $CP Makefile.am.tpl Makefile.am 331 $CP Makefile.am.tpl Makefile.am
328 332
329 for i in `ls -1 *.c|sort|grep -v memmem.c`; do 333 for i in `ls -1 *.c|sort|grep -v memmem.c`; do
330 TEST=`echo $i|sed -e "s/\.c//"` 334 TEST=`echo $i|sed -e "s/\.c//"`
335 if [[ ${tests_posix_only[*]} =~ "$TEST" ]]; then
336 echo "if !HOST_WIN" >> Makefile.am
337 fi
331 if ! [[ ${test_drivers[*]} =~ "$TEST" ]]; then 338 if ! [[ ${test_drivers[*]} =~ "$TEST" ]]; then
332 echo "TESTS += $TEST" >> Makefile.am 339 echo "TESTS += $TEST" >> Makefile.am
333 fi 340 fi
334 echo "check_PROGRAMS += $TEST" >> Makefile.am 341 echo "check_PROGRAMS += $TEST" >> Makefile.am
335 echo "${TEST}_SOURCES = $i" >> Makefile.am 342 echo "${TEST}_SOURCES = $i" >> Makefile.am
343 if [[ ${TEST} = "explicit_bzero" ]]; then
344 echo "if !HAVE_MEMMEM" >> Makefile.am
345 echo "explicit_bzero_SOURCES += memmem.c" >> Makefile.am
346 echo "endif" >> Makefile.am
347 fi
348 if [[ ${tests_posix_only[*]} =~ "$TEST" ]]; then
349 echo "endif" >> Makefile.am
350 fi
336 done 351 done
337 echo "if !HAVE_MEMMEM" >> Makefile.am
338 echo "explicit_bzero_SOURCES += memmem.c" >> Makefile.am
339 echo "endif" >> Makefile.am
340) 352)
341$CP $libcrypto_regress/evp/evptests.txt tests 353$CP $libcrypto_regress/evp/evptests.txt tests
342$CP $libcrypto_regress/aead/aeadtests.txt tests 354$CP $libcrypto_regress/aead/aeadtests.txt tests
@@ -344,8 +356,16 @@ $CP $libcrypto_regress/pqueue/expected.txt tests/pq_expected.txt
344chmod 755 tests/testssl 356chmod 755 tests/testssl
345for i in "${test_drivers[@]}"; do 357for i in "${test_drivers[@]}"; do
346 if [ -e tests/${i}.sh ]; then 358 if [ -e tests/${i}.sh ]; then
359 if [[ ${tests_posix_only[*]} =~ "$i" ]]; then
360 echo "if !HOST_WIN" >> tests/Makefile.am
361 fi
347 if ! [[ ${tests_disabled[*]} =~ "$i" ]]; then 362 if ! [[ ${tests_disabled[*]} =~ "$i" ]]; then
348 echo "TESTS += ${i}.sh" >> tests/Makefile.am 363 echo "TESTS += ${i}.sh" >> tests/Makefile.am
364 else
365 rm -f tests/$i*
366 fi
367 if [[ ${tests_posix_only[*]} =~ "$i" ]]; then
368 echo "endif" >> tests/Makefile.am
349 fi 369 fi
350 echo "EXTRA_DIST += ${i}.sh" >> tests/Makefile.am 370 echo "EXTRA_DIST += ${i}.sh" >> tests/Makefile.am
351 fi 371 fi