Add test descriptions for lcov

This commit is contained in:
Manuel Pégourié-Gonnard 2014-02-24 12:39:18 +01:00
parent 61137df560
commit 720375e7ea
3 changed files with 33 additions and 7 deletions

View File

@ -76,6 +76,9 @@ ADD_CUSTOM_TARGET(test-ref-config
COMMAND tests/scripts/test-ref-configs.pl COMMAND tests/scripts/test-ref-configs.pl
) )
# add programs/test/selftest even though the selftest functions are
# called from the testsuites since it runs them in verbose mode,
# avoiding spurious "uncovered" printf lines
ADD_CUSTOM_TARGET(covtest ADD_CUSTOM_TARGET(covtest
COMMAND make test COMMAND make test
COMMAND programs/test/selftest COMMAND programs/test/selftest
@ -84,13 +87,14 @@ ADD_CUSTOM_TARGET(covtest
) )
ADD_CUSTOM_TARGET(lcov ADD_CUSTOM_TARGET(lcov
COMMAND lcov --capture --directory . -o polarssl.info COMMAND rm -rf Coverage
COMMAND genhtml --title PolarSSL --legend --no-branch-coverage -o ../../../Coverage polarssl.info COMMAND lcov --capture --directory library/CMakeFiles/polarssl.dir -o polarssl.info
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/library/CMakeFiles/polarssl.dir COMMAND gendesc tests/Descriptions.txt -o descriptions
COMMAND genhtml --title PolarSSL --description-file descriptions --keep-descriptions --legend --no-branch-coverage -o Coverage polarssl.info
COMMAND rm -f polarssl.info descriptions
) )
ADD_CUSTOM_TARGET(memcheck ADD_CUSTOM_TARGET(memcheck
COMMAND rm -rf Coverage
COMMAND ctest -O memcheck.log -D ExperimentalMemCheck COMMAND ctest -O memcheck.log -D ExperimentalMemCheck
COMMAND tail -n1 memcheck.log | grep 'Memory checking results:' > /dev/null COMMAND tail -n1 memcheck.log | grep 'Memory checking results:' > /dev/null
COMMAND rm -f memcheck.log COMMAND rm -f memcheck.log

View File

@ -56,17 +56,23 @@ check: lib
test-ref-configs: test-ref-configs:
tests/scripts/test-ref-configs.pl tests/scripts/test-ref-configs.pl
# note: for coverage testing, build with:
# CFLAGS='--coverage' make OFLAGS='-g3 -O0'
testcov: testcov:
make check make check
# add programs/test/selftest even though the selftest functions are
# called from the testsuites since it runs them in verbose mode,
# avoiding spurious "uncovered" printf lines
programs/test/selftest programs/test/selftest
( cd tests && ./compat.sh ) ( cd tests && ./compat.sh )
( cd tests && ./ssl-opt.sh ) ( cd tests && ./ssl-opt.sh )
lcov: lcov:
rm -rf Coverage rm -rf Coverage
( cd library && lcov --capture --directory . -o polarssl.info ) lcov --capture --directory library -o polarssl.info
( cd library && genhtml --title PolarSSL --legend --no-branch-coverage \ gendesc tests/Descriptions.txt -o descriptions
-o ../Coverage polarssl.info ) genhtml --title PolarSSL --description-file descriptions --keep-descriptions --legend --no-branch-coverage -o Coverage polarssl.info
rm -f polarssl.info descriptions
apidoc: apidoc:
mkdir -p apidoc mkdir -p apidoc

16
tests/Descriptions.txt Normal file
View File

@ -0,0 +1,16 @@
test_suites
The various 'test_suite_XXX' programs from the 'tests' directory, executed
using 'make check' (Unix make) or 'make test' (Cmake), include test cases
(reference test vectors, sanity checks, etc.) for all modules except the
SSL modules.
compat
The 'tests/compat.sh' script checks interoperability with OpenSSL for every
ciphersuite, in every version, using client authentication or not. For
each ciphersuite/version it performs a full handshake and a small data
exchange.
ssl_opt
The 'tests/ssl-opt.sh' script checks various options and/or operations not
covered by compat.sh: session resumption (using session cache or tickets),
renegotiation, SNI, other extensions, etc.