You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by jd...@apache.org on 2020/07/29 14:10:33 UTC

[qpid-dispatch] 02/06: DISPATCH-1568 Remove qpid-dispatch-testing library (mocking proposal)

This is an automated email from the ASF dual-hosted git repository.

jdanek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git

commit b90d0e52c19139132b7de2e5f5c22edd9737b3f7
Author: Jiri Danek <jd...@redhat.com>
AuthorDate: Thu Jul 23 10:06:17 2020 +0200

    DISPATCH-1568 Remove qpid-dispatch-testing library (mocking proposal)
---
 include/qpid/dispatch/macros.h   | 31 -------------------------------
 src/CMakeLists.txt               | 22 +++++-----------------
 tests/CMakeLists.txt             |  8 +++-----
 tests/c_unittests/CMakeLists.txt |  7 +------
 4 files changed, 9 insertions(+), 59 deletions(-)

diff --git a/include/qpid/dispatch/macros.h b/include/qpid/dispatch/macros.h
deleted file mode 100644
index 703d91f..0000000
--- a/include/qpid/dispatch/macros.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef __macros_h__
-#define __macros_h__ 1
-
-#ifdef TESTING
-  #define STATIC
-  #define INLINE
-#else
-  #define STATIC static
-  #define INLINE inline
-#endif
-
-#endif //__macros_h__
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index deb3975..88b09ea 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -157,25 +157,13 @@ else()
   set(QPID_DISPATCH_LIB_LINK_FLAGS "-Wl,-z,defs ${QPID_DISPATCH_LIB_LINK_FLAGS}")
 endif()
 
-macro(add_shared_library library sources)
-  add_library(${library} SHARED ${sources})
-  target_include_directories(${library} PRIVATE ${qpid_dispatch_INCLUDES})
-  target_link_libraries(${library} ${qpid_dispatch_LIBRARIES})
-  set_target_properties(${library} PROPERTIES
+add_library(qpid-dispatch SHARED ${qpid_dispatch_SOURCES})
+target_include_directories(qpid-dispatch PRIVATE ${qpid_dispatch_INCLUDES})
+target_link_libraries(qpid-dispatch ${qpid_dispatch_LIBRARIES})
+set_target_properties(qpid-dispatch PROPERTIES
     LINK_FLAGS "${QPID_DISPATCH_LIB_LINK_FLAGS}")
-  install(TARGETS ${library}
+install(TARGETS qpid-dispatch
     LIBRARY DESTINATION ${QPID_DISPATCH_HOME})
-endmacro()
-
-add_shared_library(qpid-dispatch "${qpid_dispatch_SOURCES}")
-
-if (CMAKE_BUILD_TYPE MATCHES "Debug")
-    if(NOT ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8.5"))
-        add_shared_library(qpid-dispatch-testing "${qpid_dispatch_SOURCES}")
-        target_compile_definitions(qpid-dispatch-testing PUBLIC -DTESTING)
-        target_compile_options(qpid-dispatch-testing PUBLIC "-O0")
-    endif()
-endif (CMAKE_BUILD_TYPE MATCHES "Debug")
 
 # check for various function availability
 check_symbol_exists(getrlimit sys/resource.h QD_HAVE_GETRLIMIT)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 8b46e73..08df007 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -240,8 +240,6 @@ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/config-2
 install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ssl_certs
         DESTINATION ${QPID_DISPATCH_HOME_INSTALLED}/tests)
 
-if (CMAKE_BUILD_TYPE MATCHES "Debug")
-    if(NOT ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8.5"))
-add_subdirectory(c_unittests)
-    endif()
-endif (CMAKE_BUILD_TYPE MATCHES "Debug")
+if(NOT (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8.5"))
+  add_subdirectory(c_unittests)
+endif()
diff --git a/tests/c_unittests/CMakeLists.txt b/tests/c_unittests/CMakeLists.txt
index 5a189bb..a45131f 100644
--- a/tests/c_unittests/CMakeLists.txt
+++ b/tests/c_unittests/CMakeLists.txt
@@ -17,17 +17,12 @@
 ## under the License.
 ##
 
-include_directories(
-  ${CMAKE_SOURCE_DIR}/src
-  ${CMAKE_BINARY_DIR}/src
-  )
-
 file(GLOB unittest_SOURCES
     "*.cpp"
 )
 
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
 add_executable(c_unittests ${unittest_SOURCES})
-target_link_libraries(c_unittests pthread qpid-dispatch-testing )
+target_link_libraries(c_unittests pthread qpid-dispatch)
 
 add_test(c_unittests c_unittests)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org