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.
This commit is contained in:
Brent Cook
2015-03-21 19:04:54 -05:00
parent e38dc152d6
commit 45065de1ba
5 changed files with 289 additions and 89 deletions

View File

@@ -208,82 +208,12 @@ $CP $libssl_regress/ssl/testssl tests
for i in `find $libssl_regress -name '*.c'`; do
$CP "$i" tests
done
$CP $libssl_regress/certs/ca.pem tests
$CP $libssl_regress/certs/server.pem tests
# setup test drivers
# do not directly run all test programs
test_drivers=(
aeadtest
evptest
pq_test
ssltest
arc4randomforktest
pidwraptest
)
tests_posix_only=(
arc4randomforktest
explicit_bzero
pidwraptest
)
# the BIO tests rely on resolver results that are OS and environment-specific
# explicit_bzero relies on SA_ONSTACK, not available on all systems
# pidwraptest relies on an OS-specific way to give out pids and is generally
# awkward on systems with slow fork
tests_disabled=(
biotest
explicit_bzero
pidwraptest
)
$CP $libc_src/string/memmem.c tests/
(cd tests
$CP Makefile.am.tpl Makefile.am
for i in `ls -1 *.c|sort|grep -v memmem.c`; do
TEST=`echo $i|sed -e "s/\.c//"`
if ! [[ ${tests_disabled[*]} =~ "$TEST" ]]; then
if [[ ${tests_posix_only[*]} =~ "$TEST" ]]; then
echo "if !HOST_WIN" >> Makefile.am
fi
if ! [[ ${test_drivers[*]} =~ "$TEST" ]]; then
echo "TESTS += $TEST" >> Makefile.am
fi
echo "check_PROGRAMS += $TEST" >> Makefile.am
echo "${TEST}_SOURCES = $i" >> Makefile.am
if [[ ${TEST} = "explicit_bzero" ]]; then
echo "if !HAVE_MEMMEM" >> Makefile.am
echo "explicit_bzero_SOURCES += memmem.c" >> Makefile.am
echo "endif" >> Makefile.am
fi
if [[ ${tests_posix_only[*]} =~ "$TEST" ]]; then
echo "endif" >> Makefile.am
fi
fi
done
)
$CP $libcrypto_regress/evp/evptests.txt tests
$CP $libcrypto_regress/aead/aeadtests.txt tests
$CP $libcrypto_regress/pqueue/expected.txt tests/pq_expected.txt
chmod 755 tests/testssl
for i in "${test_drivers[@]}"; do
if [ -e tests/${i}.sh ]; then
if ! [[ ${tests_disabled[*]} =~ "$i" ]]; then
if [[ ${tests_posix_only[*]} =~ "$i" ]]; then
echo "if !HOST_WIN" >> tests/Makefile.am
fi
echo "TESTS += ${i}.sh" >> tests/Makefile.am
if [[ ${tests_posix_only[*]} =~ "$i" ]]; then
echo "endif" >> tests/Makefile.am
fi
echo "EXTRA_DIST += ${i}.sh" >> tests/Makefile.am
fi
fi
done
echo "EXTRA_DIST += aeadtests.txt" >> tests/Makefile.am
echo "EXTRA_DIST += evptests.txt" >> tests/Makefile.am
echo "EXTRA_DIST += pq_expected.txt" >> tests/Makefile.am
echo "EXTRA_DIST += testssl ca.pem server.pem" >> tests/Makefile.am
# add headers
(cd include/openssl
$CP Makefile.am.tpl Makefile.am
for i in `ls -1 *.h|sort`; do
@@ -291,8 +221,8 @@ echo "EXTRA_DIST += testssl ca.pem server.pem" >> tests/Makefile.am
done
)
echo "copying manpages"
# copy manpages
echo "copying manpages"
(cd man
$CP Makefile.am.tpl Makefile.am