From d8c34aabadb9e88554a2a8411f0b08b0ea90692e Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Fri, 12 Sep 2014 06:06:11 +0300 Subject: [PATCH] added log manager and query classifier tests --- log_manager/CMakeLists.txt | 5 +++-- log_manager/test/CMakeLists.txt | 5 +++++ query_classifier/CMakeLists.txt | 3 ++- query_classifier/test/CMakeLists.txt | 1 + query_classifier/test/canonical_tests/CMakeLists.txt | 4 ++++ 5 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 log_manager/test/CMakeLists.txt create mode 100644 query_classifier/test/CMakeLists.txt create mode 100644 query_classifier/test/canonical_tests/CMakeLists.txt diff --git a/log_manager/CMakeLists.txt b/log_manager/CMakeLists.txt index a5966c5c0..c451500b5 100644 --- a/log_manager/CMakeLists.txt +++ b/log_manager/CMakeLists.txt @@ -1,5 +1,6 @@ cmake_minimum_required(VERSION 2.6) -set(LOG_MANAGER_HEADERS log_manager.h) add_library(log_manager SHARED log_manager.cc) target_link_libraries(log_manager utils) -install(TARGETS log_manager DESTINATION lib) \ No newline at end of file +install(TARGETS log_manager DESTINATION lib) + +add_subdirectory(test) \ No newline at end of file diff --git a/log_manager/test/CMakeLists.txt b/log_manager/test/CMakeLists.txt new file mode 100644 index 000000000..d378bdc7c --- /dev/null +++ b/log_manager/test/CMakeLists.txt @@ -0,0 +1,5 @@ +add_executable(testlog testlog.c) +add_executable(testorder testorder.c) +target_link_libraries(testlog utils pthread log_manager) +target_link_libraries(testorder utils pthread log_manager) +add_test(NAME TestLogOrder COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/logorder.sh 500 0 500 logtest.log) \ No newline at end of file diff --git a/query_classifier/CMakeLists.txt b/query_classifier/CMakeLists.txt index 3253e910b..87c67ef62 100644 --- a/query_classifier/CMakeLists.txt +++ b/query_classifier/CMakeLists.txt @@ -1,3 +1,4 @@ set(QUERY_CLASSIFIER_HEADERS query_classifier.h) add_library(query_classifier SHARED query_classifier.cc ${MYSQL_HEADERS}) -install(TARGETS query_classifier DESTINATION lib) \ No newline at end of file +install(TARGETS query_classifier DESTINATION lib) +add_subdirectory(test) \ No newline at end of file diff --git a/query_classifier/test/CMakeLists.txt b/query_classifier/test/CMakeLists.txt new file mode 100644 index 000000000..ceaad8110 --- /dev/null +++ b/query_classifier/test/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(canonical_tests) \ No newline at end of file diff --git a/query_classifier/test/canonical_tests/CMakeLists.txt b/query_classifier/test/canonical_tests/CMakeLists.txt new file mode 100644 index 000000000..4695d8045 --- /dev/null +++ b/query_classifier/test/canonical_tests/CMakeLists.txt @@ -0,0 +1,4 @@ +file(COPY ${ERRMSG} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) +add_executable(canonizer canonizer.c) +target_link_libraries(canonizer pthread query_classifier z dl ssl aio crypt crypto rt m ${EMBEDDED_LIB} fullcore) +add_test(NAME TestCanonicalQuery COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/canontest.sh testcanon.log input.sql output.sql expected.sql) \ No newline at end of file