From 720375e7ea601b1638e26cc604a63eb21973a131 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Mon, 24 Feb 2014 12:39:18 +0100 Subject: [PATCH] Add test descriptions for lcov --- CMakeLists.txt | 12 ++++++++---- Makefile | 12 +++++++++--- tests/Descriptions.txt | 16 ++++++++++++++++ 3 files changed, 33 insertions(+), 7 deletions(-) create mode 100644 tests/Descriptions.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 592417a58..ac4be4c02 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,6 +76,9 @@ ADD_CUSTOM_TARGET(test-ref-config 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 COMMAND make test COMMAND programs/test/selftest @@ -84,13 +87,14 @@ ADD_CUSTOM_TARGET(covtest ) ADD_CUSTOM_TARGET(lcov - COMMAND lcov --capture --directory . -o polarssl.info - COMMAND genhtml --title PolarSSL --legend --no-branch-coverage -o ../../../Coverage polarssl.info - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/library/CMakeFiles/polarssl.dir + COMMAND rm -rf Coverage + COMMAND lcov --capture --directory library/CMakeFiles/polarssl.dir -o polarssl.info + 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 - COMMAND rm -rf Coverage COMMAND ctest -O memcheck.log -D ExperimentalMemCheck COMMAND tail -n1 memcheck.log | grep 'Memory checking results:' > /dev/null COMMAND rm -f memcheck.log diff --git a/Makefile b/Makefile index e9eb11fc5..d8485b281 100644 --- a/Makefile +++ b/Makefile @@ -56,17 +56,23 @@ check: lib test-ref-configs: tests/scripts/test-ref-configs.pl +# note: for coverage testing, build with: +# CFLAGS='--coverage' make OFLAGS='-g3 -O0' testcov: 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 ( cd tests && ./compat.sh ) ( cd tests && ./ssl-opt.sh ) lcov: rm -rf Coverage - ( cd library && lcov --capture --directory . -o polarssl.info ) - ( cd library && genhtml --title PolarSSL --legend --no-branch-coverage \ - -o ../Coverage polarssl.info ) + lcov --capture --directory library -o polarssl.info + gendesc tests/Descriptions.txt -o descriptions + genhtml --title PolarSSL --description-file descriptions --keep-descriptions --legend --no-branch-coverage -o Coverage polarssl.info + rm -f polarssl.info descriptions apidoc: mkdir -p apidoc diff --git a/tests/Descriptions.txt b/tests/Descriptions.txt new file mode 100644 index 000000000..5b546e939 --- /dev/null +++ b/tests/Descriptions.txt @@ -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.