libftdi-git Archives

Subject: A library to talk to FTDI chips branch, master, updated. v1.1-12-g2ecba57

From: libftdi-git@xxxxxxxxxxxxxxxxxxxxxxx
To: libftdi-git@xxxxxxxxxxxxxxxxxxxxxxx
Date: Mon, 14 Jul 2014 16:28:45 +0200 (CEST)
The branch, master has been updated
       via  2ecba5704ca7304820250fa71a5e168651bd8e8f (commit)
      from  4ce11b8c6a127cee26d950ea99f61cc67f76ea63 (commit)


- Log -----------------------------------------------------------------
commit 2ecba5704ca7304820250fa71a5e168651bd8e8f
Author: Samuel Bryner <s.bryner@xxxxxxxxx>
Date:   Mon Jul 14 16:28:29 2014 +0200

    Make build of the unit tests configurable

-----------------------------------------------------------------------

Summary of changes:
 CMakeLists.txt      |    2 ++
 test/CMakeLists.txt |   42 +++++++++++++++++++++++++-----------------
 2 files changed, 27 insertions(+), 17 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 08e5771..ee21a8f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -113,6 +113,8 @@ add_custom_target(dist
             | bzip2 > ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar.bz2
     WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
 
+# Tests
+option ( BUILD_TESTS "Build unit tests with Boost Unit Test framework" ON )
 
 # Documentation
 option ( DOCUMENTATION "Generate API documentation with Doxygen" ON )
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 53e3f7b..74e1c10 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -1,30 +1,38 @@
 # Optional unit test
 
-find_package(Boost COMPONENTS unit_test_framework)
+if(BUILD_TESTS)
 
-if(Boost_UNIT_TEST_FRAMEWORK_FOUND)
+    find_package(Boost COMPONENTS unit_test_framework)
 
-    message(STATUS "Building unit test")
+    if(Boost_UNIT_TEST_FRAMEWORK_FOUND)
 
-    enable_testing()
+        message(STATUS "Building unit test")
 
-    INCLUDE_DIRECTORIES(BEFORE ${CMAKE_SOURCE_DIR}/src ${Boost_INCLUDE_DIRS})
+        enable_testing()
 
-    set(cpp_tests
-        basic.cpp
-        baudrate.cpp
-    )
+        INCLUDE_DIRECTORIES(BEFORE ${CMAKE_SOURCE_DIR}/src 
${Boost_INCLUDE_DIRS})
 
-    add_executable(test_libftdi1 ${cpp_tests})
-    target_link_libraries(test_libftdi1 ftdi1 
${Boost_UNIT_TEST_FRAMEWORK_LIBRARIES})
+        set(cpp_tests
+            basic.cpp
+            baudrate.cpp
+        )
 
-    add_test(test_libftdi1 test_libftdi1)
+        add_executable(test_libftdi1 ${cpp_tests})
+        target_link_libraries(test_libftdi1 ftdi1 
${Boost_UNIT_TEST_FRAMEWORK_LIBRARIES})
 
-    # Add custom target so we run easily run "make check"
-    add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} DEPENDS 
test_libftdi1)
+        add_test(test_libftdi1 test_libftdi1)
 
-else(Boost_UNIT_TEST_FRAMEWORK_FOUND)
+        # Add custom target so we run easily run "make check"
+        add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} DEPENDS 
test_libftdi1)
 
-    message(STATUS "NOT building unit test (requires boost unit test 
framework)")
+    else(Boost_UNIT_TEST_FRAMEWORK_FOUND)
 
-endif(Boost_UNIT_TEST_FRAMEWORK_FOUND)
+        message(STATUS "NOT building unit test (requires boost unit test 
framework)")
+
+    endif(Boost_UNIT_TEST_FRAMEWORK_FOUND)
+
+else(BUILD_TESTS)
+
+    message(STATUS "NOT building unit test")
+
+endif(BUILD_TESTS)


hooks/post-receive
-- 
A library to talk to FTDI chips

--
libftdi-git - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi-git+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Current Thread
  • A library to talk to FTDI chips branch, master, updated. v1.1-12-g2ecba57, libftdi-git <=