add_executable(profile_trxboundaryparser profile_trxboundaryparser.cc)
add_executable(test_adminusers test_adminusers.cc)
add_executable(test_atomic test_atomic.cc)
add_executable(test_buffer test_buffer.cc)
add_executable(test_config test_config.cc)
add_executable(test_dcb test_dcb.cc)
add_executable(test_filter test_filter.cc)
add_executable(test_hash test_hash.cc)
add_executable(test_hint test_hint.cc)
add_executable(test_http test_http.cc)
add_executable(test_json test_json.cc)
add_executable(test_log test_log.cc)
add_executable(test_logorder test_logorder.cc)
add_executable(test_logthrottling test_logthrottling.cc)
add_executable(test_maxscalepcre2 test_maxscalepcre2.cc)
add_executable(test_modulecmd test_modulecmd.cc)
add_executable(test_modutil test_modutil.cc)
add_executable(test_poll test_poll.cc)
add_executable(test_semaphore test_semaphore.cc)
add_executable(test_server test_server.cc)
add_executable(test_service test_service.cc)
add_executable(test_spinlock test_spinlock.cc)
add_executable(test_thread test_thread.cc)
add_executable(test_trxcompare test_trxcompare.cc ../../../query_classifier/test/testreader.cc)
add_executable(test_trxtracking test_trxtracking.cc)
add_executable(test_users test_users.cc)
add_executable(test_utils test_utils.cc)

target_link_libraries(profile_trxboundaryparser maxscale-common)
target_link_libraries(test_adminusers maxscale-common)
target_link_libraries(test_atomic maxscale-common)
target_link_libraries(test_buffer maxscale-common)
target_link_libraries(test_config maxscale-common)
target_link_libraries(test_dcb maxscale-common)
target_link_libraries(test_filter maxscale-common)
target_link_libraries(test_hash maxscale-common)
target_link_libraries(test_hint maxscale-common)
target_link_libraries(test_http maxscale-common)
target_link_libraries(test_json maxscale-common)
target_link_libraries(test_log maxscale-common)
target_link_libraries(test_logorder maxscale-common)
target_link_libraries(test_logthrottling maxscale-common)
target_link_libraries(test_maxscalepcre2 maxscale-common)
target_link_libraries(test_modulecmd maxscale-common)
target_link_libraries(test_modutil maxscale-common)
target_link_libraries(test_poll maxscale-common)
target_link_libraries(test_semaphore maxscale-common)
target_link_libraries(test_server maxscale-common)
target_link_libraries(test_service maxscale-common)
target_link_libraries(test_spinlock maxscale-common)
target_link_libraries(test_thread maxscale-common)
target_link_libraries(test_trxcompare maxscale-common)
target_link_libraries(test_trxtracking maxscale-common)
target_link_libraries(test_users maxscale-common)
target_link_libraries(test_utils maxscale-common)

add_test(test_adminusers test_adminusers)
add_test(test_atomic test_atomic)
add_test(test_buffer test_buffer)
add_test(test_config test_config)
add_test(test_dcb test_dcb)
add_test(test_filter test_filter)
add_test(test_hash test_hash)
add_test(test_hint test_hint)
add_test(test_http test_http)
add_test(test_json test_json)
add_test(test_log test_log)
add_test(NAME test_logorder COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/logorder.sh  200 0 1000 ${CMAKE_CURRENT_BINARY_DIR}/logorder.log)
add_test(test_logthrottling test_logthrottling)
add_test(NAME test_maxpasswd COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/test_maxpasswd.sh)
add_test(test_maxscalepcre2 test_maxscalepcre2)
add_test(test_modulecmd test_modulecmd)
add_test(test_modutil test_modutil)
add_test(test_poll test_poll)
add_test(test_semaphore test_semaphore)
add_test(test_server test_server)
add_test(test_service test_service)
add_test(test_spinlock test_spinlock)
add_test(test_thread test_thread)
add_test(test_trxcompare_create test_trxcompare ${CMAKE_CURRENT_SOURCE_DIR}/../../../query_classifier/test/create.test)
add_test(test_trxcompare_delete test_trxcompare ${CMAKE_CURRENT_SOURCE_DIR}/../../../query_classifier/test/delete.test)
add_test(test_trxcompare_insert test_trxcompare ${CMAKE_CURRENT_SOURCE_DIR}/../../../query_classifier/test/insert.test)
add_test(test_trxcompare_join test_trxcompare ${CMAKE_CURRENT_SOURCE_DIR}/../../../query_classifier/test/join.test)
add_test(test_trxcompare_select test_trxcompare ${CMAKE_CURRENT_SOURCE_DIR}/../../../query_classifier/test/select.test)
add_test(test_trxcompare_set test_trxcompare ${CMAKE_CURRENT_SOURCE_DIR}/../../../query_classifier/test/set.test)
add_test(test_trxcompare_update test_trxcompare ${CMAKE_CURRENT_SOURCE_DIR}/../../../query_classifier/test/update.test)
add_test(test_trxcompare_maxscale test_trxcompare ${CMAKE_CURRENT_SOURCE_DIR}/../../../query_classifier/test/maxscale.test)
add_test(test_trxtracking test_trxtracking)
add_test(test_users test_users)
add_test(test_utils test_utils)

add_subdirectory(rest-api)
