diff options
author | Anderson Toshiyuki Sasaki <ansasaki@redhat.com> | 2018-11-21 13:59:42 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2018-11-28 15:51:06 +0100 |
commit | 1f6b92973547234a00fbdd445840b181c631d91d (patch) | |
tree | 26b8d3a423874e7189ad15368d302138aeec5ecd /CMakeLists.txt | |
parent | 74285d3aca3f3a00c35dc3966b381e6f36507fad (diff) | |
download | libssh-1f6b92973547234a00fbdd445840b181c631d91d.tar.gz libssh-1f6b92973547234a00fbdd445840b181c631d91d.tar.xz libssh-1f6b92973547234a00fbdd445840b181c631d91d.zip |
tests: Replace tests filtering with cmocka builtin filter
This completely removes the tests filter code from torture.c and calls
cmocka_set_test_filter() instead, if available. The checks for required
libraries, headers, and the availability of cmocka_set_test_filter()
were added to the cmake configuration.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f2be383..e2188a38 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,6 +70,10 @@ else (WITH_GCRYPT) endif (NOT OPENSSL_FOUND) endif(WITH_GCRYPT) +if (UNIT_TESTING) + find_package(CMocka REQUIRED) +endif () + # Find out if we have threading available set(CMAKE_THREAD_PREFER_PTHREADS ON) set(THREADS_PREFER_PTHREAD_FLAG ON) @@ -150,9 +154,8 @@ if (WITH_EXAMPLES) endif (WITH_EXAMPLES) if (UNIT_TESTING) - find_package(CMocka REQUIRED) - include(AddCMockaTest) - add_subdirectory(tests) + include(AddCMockaTest) + add_subdirectory(tests) endif (UNIT_TESTING) ### SOURCE PACKAGE |