MXS-2900 Move testcore library files to a dedicated directory

The library is now named "maxtest". The related include-files are, for
now, usable without designating the full include path. This may be changed
later, but would require modifying every test.
This commit is contained in:
Esa Korhonen 2019-11-22 14:58:09 +02:00
parent e180c20055
commit 96ba2da40c
58 changed files with 43 additions and 19 deletions

View File

@ -26,23 +26,14 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_SOURCE_DIR}/connectors/cdc-connector)
# The core library
include_directories(${CMAKE_BINARY_DIR})
add_library(testcore SHARED testconnections.cpp nodes.cpp mariadb_nodes.cpp maxscales.cpp
mariadb_func.cpp get_com_select_insert.cpp maxadmin_operations.cpp big_transaction.cpp
sql_t1.cpp test_binlog_fnc.cpp get_my_ip.cpp big_load.cpp get_com_select_insert.cpp
different_size.cpp fw_copy_rules maxinfo_func.cpp config_operations.cpp rds_vpc.cpp execute_cmd.cpp
blob_test.cpp keepalived_func.cpp tcp_connection.cpp base/stopwatch.cpp fw_copy_rules.cpp
labels_table.cpp envv.cpp
# Include the CDC connector in the core library
${CMAKE_SOURCE_DIR}/connectors/cdc-connector/cdc_connector.cpp)
target_link_libraries(testcore ${MARIADB_CONNECTOR_LIBRARIES} ${JANSSON_LIBRARIES} z m pthread ssl dl rt crypto crypt maxbase)
install(TARGETS testcore DESTINATION system-test)
add_dependencies(testcore connector-c jansson maxbase)
# Include the CDC connector headers
include_directories(${CMAKE_SOURCE_DIR}/../connectors/cdc-connector/)
# The core testing library
add_subdirectory(maxtest)
include_directories(maxtest/include/maxtest)
# Tool used to check backend state
add_test_executable_notest(check_backend.cpp check_backend check_backend LABELS CONFIG REPL_BACKEND GALERA_BACKEND TWO_MAXSCALES)

View File

@ -2,7 +2,7 @@
* @file cdc_connect.cpp Test the CDC protocol
*/
#include "../testconnections.h"
#include "testconnections.h"
#include <cdc_connector.h>
#include "cdc_result.h"
#include <iostream>

View File

@ -0,0 +1,2 @@
include_directories(include/maxtest)
add_subdirectory(src)

View File

@ -0,0 +1,31 @@
add_library(maxtest SHARED
stopwatch.cpp
big_load.cpp
big_transaction.cpp
blob_test.cpp
config_operations.cpp
different_size.cpp
envv.cpp
execute_cmd.cpp
fw_copy_rules.cpp
get_com_select_insert.cpp
get_my_ip.cpp
keepalived_func.cpp
labels_table.cpp
mariadb_func.cpp
mariadb_nodes.cpp
maxadmin_operations.cpp
maxinfo_func.cpp
maxscales.cpp
nodes.cpp
rds_vpc.cpp
sql_t1.cpp
tcp_connection.cpp
test_binlog_fnc.cpp
testconnections.cpp
# Include the CDC connector in the core library
${CMAKE_SOURCE_DIR}/connectors/cdc-connector/cdc_connector.cpp)
target_link_libraries(maxtest ${MARIADB_CONNECTOR_LIBRARIES} ${JANSSON_LIBRARIES} z m pthread ssl dl rt crypto crypt maxbase)
set_target_properties(maxtest PROPERTIES VERSION "1.0.0" LINK_FLAGS -Wl,-z,defs)
install(TARGETS maxtest DESTINATION system-test)
add_dependencies(maxtest connector-c jansson maxbase)

View File

@ -4,8 +4,8 @@
*/
#include "testconnections.h"
#include <base/stopwatch.h>
#include <base/appexception.h>
#include "stopwatch.h"
#include "appexception.h"
#include <iostream>
#include <memory>
#include <sstream>

View File

@ -11,7 +11,7 @@
* Public License.
*/
#include "testconnections.h"
#include "mariadb_nodes.h"
#include "failover_common.cpp"
int main(int argc, char** argv)

View File

@ -26,7 +26,7 @@ set(TIMEOUT 3600)
function(add_test_executable source name template)
add_template(${name} ${template} "${ARGV}")
add_executable(${name} ${source})
target_link_libraries(${name} testcore)
target_link_libraries(${name} maxtest)
add_test(NAME ${name} COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${name} ${name} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
list(REMOVE_AT ARGV 0 1 2 3)
@ -42,7 +42,7 @@ endfunction()
function(add_test_executable_notest source name template)
add_template(${name} ${template} "${ARGV}")
add_executable(${name} ${source})
target_link_libraries(${name} testcore)
target_link_libraries(${name} maxtest)
endfunction()
# Add a test which uses another test as the executable