From 203501c14afaf6704d965de0ae7de3474424d166 Mon Sep 17 00:00:00 2001 From: "Hoa V. DINH" Date: Tue, 25 Nov 2014 15:22:09 -0800 Subject: Refactored CMakefiles, unit tests for Linux enabled --- unittest/CMakeLists.txt | 16 ++++++++++++++++ unittest/unittest.cpp | 4 ++++ 2 files changed, 20 insertions(+) create mode 100644 unittest/CMakeLists.txt (limited to 'unittest') diff --git a/unittest/CMakeLists.txt b/unittest/CMakeLists.txt new file mode 100644 index 00000000..3437518a --- /dev/null +++ b/unittest/CMakeLists.txt @@ -0,0 +1,16 @@ +include_directories( + ${CMAKE_CURRENT_BINARY_DIR}/../src/include + ${GLIB2_INCLUDE_DIRS} +) + +link_directories( + ${additional_lib_searchpath} +) + +add_executable (unittestcpp unittest.cpp) +target_link_libraries ( + unittestcpp MailCore + ${ZLIB_LIBRARY} ${LIBETPAN_LIBRARY} ${LIBXML_LIBRARY} ${UCHARDET_LIBRARY} sasl2 + ${TIDY_LIBRARY} ${CTEMPLATE_LIBRARY} ssl crypto ${linux_libraries} ${mac_libraries} ${ICU4C_LIBRARY} + ${GLIB2_LIBRARIES} ${FOUNDATIONFRAMEWORK} ${SECURITYFRAMEWORK} ${CORESERVICESFRAMEWORK} +) diff --git a/unittest/unittest.cpp b/unittest/unittest.cpp index a96a82e2..f79397f4 100644 --- a/unittest/unittest.cpp +++ b/unittest/unittest.cpp @@ -319,5 +319,9 @@ int main(int argc, char ** argv) pool->release(); + if (global_failure > 0) { + exit(EXIT_FAILURE); + } + exit(EXIT_SUCCESS); } \ No newline at end of file -- cgit v1.2.3