Land #669, add new tests

This commit is contained in:
Brent Cook 2021-05-21 02:35:20 -05:00
commit 31dc716df3
5 changed files with 48 additions and 0 deletions

View File

@ -62,3 +62,6 @@ matrix:
script:
"./scripts/travis"
after_failure:
"./scripts/travis_failure"

18
scripts/travis_failure Executable file
View File

@ -0,0 +1,18 @@
#!/bin/sh
CWD=`pwd`
testsdir=`ls -d libressl-*/_build/sub/tests`
if [ -d "$testsdir" ] ; then
echo "##### test logs in $testsdir"
cd $testsdir
for i in `ls *.trs` ; do
grep ':test-result: PASS' $i > /dev/null
if [ $? -eq 1 ] ; then
log=`echo $i | sed 's/\.trs$/\.log/'`
echo "***** $log"
cat $log
fi
done
cd $CWD
fi

View File

@ -173,6 +173,14 @@ add_executable(dsatest dsatest.c)
target_link_libraries(dsatest ${OPENSSL_LIBS})
add_test(dsatest dsatest)
# dtlstest
if(NOT WIN32)
add_executable(dtlstest dtlstest.c)
target_link_libraries(dtlstest ${OPENSSL_LIBS})
add_test(NAME dtlstest COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/dtlstest.sh)
set_tests_properties(dtlstest PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}")
endif()
if(NOT BUILD_SHARED_LIBS)
# ec_point_conversion
add_executable(ec_point_conversion ec_point_conversion.c)

View File

@ -171,6 +171,12 @@ TESTS += dsatest
check_PROGRAMS += dsatest
dsatest_SOURCES = dsatest.c
# dtlstest
TESTS += dtlstest.sh
check_PROGRAMS += dtlstest
dtlstest_SOURCES = dtlstest.c
EXTRA_DIST += dtlstest.sh
# ec_point_conversion
TESTS += ec_point_conversion
check_PROGRAMS += ec_point_conversion

13
tests/dtlstest.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/sh
set -e
dtlstest_bin=./dtlstest
if [ -e ./dtlstest.exe ]; then
dtlstest_bin=./dtlstest.exe
fi
if [ -z $srcdir ]; then
srcdir=.
fi
$dtlstest_bin $srcdir/server.pem $srcdir/server.pem $srcdir/ca.pem