List:Commits« Previous MessageNext Message »
From:Rafal Somla Date:March 8 2013 1:18pm
Subject:bzr push into connector-c-6.1 branch (rafal.somla:5655 to 5656)
View as plain text  
 5656 Rafal Somla	2013-03-08
      Connector/C: Internal testing framework

    added:
      tests.cmake
    modified:
      CMakeLists.txt
      client/CMakeLists.txt
 5655 Rafal Somla	2013-03-06
      Connector/C: Remove non-libmysql headers - fix cmake INSTALL directives.

    modified:
      include/CMakeLists.txt
=== modified file 'CMakeLists.txt'
--- a/CMakeLists.txt	2013-03-06 14:29:30 +0000
+++ b/CMakeLists.txt	2013-03-08 13:17:25 +0000
@@ -198,8 +198,16 @@ SET(sources_copied YES CACHE INTERNAL "I
 ENDIF(NOT sources_copied)
 
 #
-# Configuring build from the generated sources
-# ============================================
+# Internal tests configuration
+# ==============================
+
+CONFIGURE_FILE(tests.cmake ${TEST_DIR}/CMakeLists.txt @ONLY)
+CONFIGURE_FILE(VERSION    ${TEST_DIR}/VERSION COPYONLY)
+CONFIGURE_FILE(VERSION.server    ${TEST_DIR}/VERSION.server COPYONLY)
+
+#
+# Configuring Connector/C build from the generated sources
+# ========================================================
 
 OPTION(SKIP_CONFIGURATION
        "Skip running cmake to configure build from the generated sources."

=== modified file 'client/CMakeLists.txt'
--- a/client/CMakeLists.txt	2012-11-21 12:44:48 +0000
+++ b/client/CMakeLists.txt	2013-03-08 13:17:25 +0000
@@ -53,19 +53,12 @@ TARGET_LINK_LIBRARIES(mysqldump mysqlcli
 MYSQL_ADD_EXECUTABLE(mysqlimport mysqlimport.c)
 TARGET_LINK_LIBRARIES(mysqlimport mysqlclient)
 
-MYSQL_ADD_EXECUTABLE(mysql_upgrade mysql_upgrade.c)
-TARGET_LINK_LIBRARIES(mysql_upgrade mysqlclient)
-ADD_DEPENDENCIES(mysql_upgrade GenFixPrivs)
-
 MYSQL_ADD_EXECUTABLE(mysqlshow mysqlshow.c)
 TARGET_LINK_LIBRARIES(mysqlshow mysqlclient)
 
 MYSQL_ADD_EXECUTABLE(mysql_plugin mysql_plugin.c)
 TARGET_LINK_LIBRARIES(mysql_plugin mysqlclient)
 
-MYSQL_ADD_EXECUTABLE(mysqlbinlog mysqlbinlog.cc)
-TARGET_LINK_LIBRARIES(mysqlbinlog mysqlclient)
-
 MYSQL_ADD_EXECUTABLE(mysqladmin mysqladmin.cc)
 TARGET_LINK_LIBRARIES(mysqladmin mysqlclient)
 
@@ -83,7 +76,6 @@ ENDIF(WIN32)
 
 SET_TARGET_PROPERTIES (
   mysql_plugin 
-  mysql_upgrade
   mysqlcheck
   mysqldump
   mysqlimport

=== added file 'tests.cmake'
--- a/tests.cmake	1970-01-01 00:00:00 +0000
+++ b/tests.cmake	2013-03-08 13:17:25 +0000
@@ -0,0 +1,158 @@
+
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+
+PROJECT("Internal LibMySQL Tests")
+
+#
+#  Buiding client apps from server sources
+# =========================================
+# 
+# Apps are linked against libmysql taken from Connecor/C build.
+# 
+
+SET(WITH_MYSQL "@CMAKE_SOURCE_DIR@"
+    CACHE PATH "Path to MySQL server sources")
+
+IF(NOT EXISTS ${WITH_MYSQL}/client/CMakeLists.txt)
+  MESSAGE(FATAL_ERROR "Could not find client sources at ${WITH_MYSQL}")
+ENDIF()
+
+
+SET(WITH_CONNC "@BUILD_DIR@"
+    CACHE PATH "Path to location where Connector/C was built")
+
+MESSAGE("Building client applications from sources in: ${WITH_MYSQL}")
+MESSAGE("Using client libs from: ${WITH_CONNC}")
+
+#
+# Import libraries from Connector/C build
+#
+
+FUNCTION(IMPORT_LIBRARY dir name target)
+
+  ADD_LIBRARY(${target} STATIC IMPORTED)
+
+  SET(library_found 0)
+  SET(library_path NOTFOUND)
+
+  FIND_LIBRARY(library_path
+    NAMES ${name}
+    NO_DEFAULT_PATH
+    NO_CMAKE_PATH
+    PATHS ${dir}
+  )
+
+  IF(library_path)
+    SET_TARGET_PROPERTIES(${target} PROPERTIES
+      IMPORTED_LOCATION "${library_path}"
+    )
+    MESSAGE(STATUS "Importing: ${library_path}")
+    SET(library_found 1)
+  ENDIF()
+
+  FOREACH(config Release Debug RelWithDebInfo)
+
+    STRING(TOUPPER ${config} CONFIG)
+    SET(library_path NOTFOUND)
+
+    FIND_LIBRARY(library_path
+      NAMES ${name}
+      NO_DEFAULT_PATH
+      NO_CMAKE_PATH
+      PATHS ${dir}
+      PATH_SUFFIXES ${config}
+    )
+
+    IF(library_path)
+      SET_PROPERTY(TARGET ${target} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${CONFIG})
+      SET_TARGET_PROPERTIES(${target} PROPERTIES
+        IMPORTED_LOCATION_${CONFIG} "${library_path}"
+      )
+      MESSAGE(STATUS "Importing: ${library_path}")
+      SET(library_found 1)
+    ENDIF()
+
+  ENDFOREACH(config)
+
+  #
+  # Communicate result of this command to the calling context
+  #
+  SET(library_found ${library_found} CACHE INTERNAL "Result of IMPORT_LIBRARAY command" FORCE)
+
+ENDFUNCTION(IMPORT_LIBRARY)
+
+
+IMPORT_LIBRARY(${WITH_CONNC}/libmysql mysqlclient mysqlclient)
+
+IF(NOT ${library_found})
+  MESSAGE(FATAL_ERROR "Could not find mysqlclient library at ${WITH_CONNC}/libmysql")
+ENDIF()
+
+IMPORT_LIBRARY(${WITH_CONNC}/regex regex regex)
+
+IF(NOT ${library_found})
+  MESSAGE(FATAL_ERROR "Could not find regex library at ${WITH_CONNC}/regex")
+ENDIF()
+
+
+#
+# Copy headers generated during Connector/C build
+#
+
+FOREACH(header my_config.h mysql_version.h mysqld_error.h mysqld_ername.h)
+
+IF(NOT EXISTS ${WITH_CONNC}/include/${header})
+  MESSAGE(FATAL_ERROR "Could not find ${header} header at ${WITH_CONNC}/include")
+ENDIF()
+CONFIGURE_FILE(${WITH_CONNC}/include/${header} client COPYONLY)
+
+ENDFOREACH(header)
+
+
+# Include the platform-specific file. To allow exceptions, this code
+# looks for files in order of how specific they are. If there is, for
+# example, a generic Linux.cmake and a version-specific
+# Linux-2.6.28-11-generic, it will pick Linux-2.6.28-11-generic and
+# include it. It is then up to the file writer to include the generic
+# version if necessary.
+FOREACH(_base
+    ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_VERSION}-${CMAKE_SYSTEM_PROCESSOR}
+    ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_VERSION}
+    ${CMAKE_SYSTEM_NAME})
+  SET(_file ${WITH_MYSQL}/cmake/os/${_base}.cmake)
+  IF(EXISTS ${_file})
+    # MESSAGE(STATUS "Including ${_file}")
+    INCLUDE(${_file})
+    BREAK()
+  ENDIF()
+ENDFOREACH()
+
+#
+# Include macros used by client configuration
+#
+
+SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${WITH_MYSQL}/cmake)
+
+INCLUDE(mysql_version)
+INCLUDE(install_macros)
+INCLUDE(install_layout)
+INCLUDE(mysql_add_executable)
+
+
+# TODO: support openSSL
+
+MACRO(COPY_OPENSSL_DLLS)
+ENDMACRO(COPY_OPENSSL_DLLS)
+
+# TODO: support readline on unix platforms
+
+#
+# Include client sources from MySQL source tree.
+#
+# Note: we have to change CMAKE_SOURCE_DIR because things like include paths
+# are expressed in terms of this variable.
+#
+
+SET(CMAKE_SOURCE_DIR ${WITH_MYSQL})
+
+ADD_SUBDIRECTORY(${WITH_MYSQL}/client client)

No bundle (reason: useless for push emails).
Thread
bzr push into connector-c-6.1 branch (rafal.somla:5655 to 5656) Rafal Somla3 Apr