aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorManuel Pégourié-Gonnard <mpg@elzevir.fr>2015-07-01 10:06:27 +0200
committerManuel Pégourié-Gonnard <mpg@elzevir.fr>2015-07-01 10:08:08 +0200
commitd3a9166afee16f81c966e19be1a407be02c9b37c (patch)
treee0b9d0cfe3c4f11388acf7024c9d4a44926a632e /CMakeLists.txt
parentabc729e664e0716242c428067cac0f822d63fc37 (diff)
downloadmbedtls-d3a9166afee16f81c966e19be1a407be02c9b37c.zip
mbedtls-d3a9166afee16f81c966e19be1a407be02c9b37c.tar.gz
mbedtls-d3a9166afee16f81c966e19be1a407be02c9b37c.tar.bz2
Adjust prerequisites for tests in cmake
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt60
1 files changed, 33 insertions, 27 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 516b006..5752e93 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -73,31 +73,37 @@ ADD_CUSTOM_TARGET(apidoc
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
if(ENABLE_TESTING)
- add_subdirectory(tests)
-
- ADD_CUSTOM_TARGET(covtest
- COMMAND make test
- COMMAND programs/test/selftest
- COMMAND cd tests && ./compat.sh
- COMMAND cd tests && ./ssl-opt.sh
- )
-
- ADD_CUSTOM_TARGET(lcov
- COMMAND rm -rf Coverage
- COMMAND lcov --capture --initial --directory library/CMakeFiles/mbedtls.dir -o files.info
- COMMAND lcov --capture --directory library/CMakeFiles/mbedtls.dir -o tests.info
- COMMAND lcov --add-tracefile files.info --add-tracefile tests.info -o all.info
- COMMAND lcov --remove all.info -o final.info '*.h'
- COMMAND gendesc tests/Descriptions.txt -o descriptions
- COMMAND genhtml --title "mbed TLS" --description-file descriptions --keep-descriptions --legend --no-branch-coverage -o Coverage final.info
- COMMAND rm -f files.info tests.info all.info final.info descriptions
- )
-
- ADD_CUSTOM_TARGET(memcheck
- COMMAND sed -i.bak s+/usr/bin/valgrind+`which valgrind`+ DartConfiguration.tcl
- COMMAND ctest -O memcheck.log -D ExperimentalMemCheck
- COMMAND tail -n1 memcheck.log | grep 'Memory checking results:' > /dev/null
- COMMAND rm -f memcheck.log
- COMMAND mv DartConfiguration.tcl.bak DartConfiguration.tcl
- )
+ find_package(PERL)
+
+ if(PERL_FOUND)
+ add_subdirectory(tests)
+
+ if(UNIX)
+ ADD_CUSTOM_TARGET(covtest
+ COMMAND make test
+ COMMAND programs/test/selftest
+ COMMAND cd tests && ./compat.sh
+ COMMAND cd tests && ./ssl-opt.sh
+ )
+
+ ADD_CUSTOM_TARGET(lcov
+ COMMAND rm -rf Coverage
+ COMMAND lcov --capture --initial --directory library/CMakeFiles/mbedtls.dir -o files.info
+ COMMAND lcov --capture --directory library/CMakeFiles/mbedtls.dir -o tests.info
+ COMMAND lcov --add-tracefile files.info --add-tracefile tests.info -o all.info
+ COMMAND lcov --remove all.info -o final.info '*.h'
+ COMMAND gendesc tests/Descriptions.txt -o descriptions
+ COMMAND genhtml --title "mbed TLS" --description-file descriptions --keep-descriptions --legend --no-branch-coverage -o Coverage final.info
+ COMMAND rm -f files.info tests.info all.info final.info descriptions
+ )
+
+ ADD_CUSTOM_TARGET(memcheck
+ COMMAND sed -i.bak s+/usr/bin/valgrind+`which valgrind`+ DartConfiguration.tcl
+ COMMAND ctest -O memcheck.log -D ExperimentalMemCheck
+ COMMAND tail -n1 memcheck.log | grep 'Memory checking results:' > /dev/null
+ COMMAND rm -f memcheck.log
+ COMMAND mv DartConfiguration.tcl.bak DartConfiguration.tcl
+ )
+ endif(UNIX)
+ endif(PERL_FOUND)
endif()