diff --git a/CMakeLists.txt b/CMakeLists.txt index b34f7e2f6..7c209452f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,9 @@ FILE(GLOB CRYPTO "src/cpp/Crypto/*.h" "src/cpp/Crypto/*.cpp") FILE(GLOB MAIN "src/cpp/*.cpp" "src/cpp/*.c" "src/cpp/*.h") FILE(GLOB MYSQL "src/cpp/MySQL/*.cpp" "src/cpp/MySQL/*.h" "src/cpp/MySQL/Poco/*.h") FILE(GLOB PROTO_GRADIDO "src/cpp/proto/gradido/*.cc" "src/cpp/proto/gradido/*.h") +# used only for test project +FILE(GLOB TEST "src/cpp/test/*.cpp" "src/cpp/test/*.h") + SET(LOCAL_SRCS ${TINF} ${MAIN} ${HTTPInterface} ${JSONInterface} ${CRYPTO} ${MODEL} @@ -49,7 +52,7 @@ source_group("SingletonManager" FILES ${SINGLETON_MANAGER}) source_group("lib" FILES ${LIB_SRC}) source_group("HTTP-Interface" FILES ${HTTPInterface}) source_group("Json-Interface" FILES ${JSONInterface}) - +source_group("Test" FILES ${TEST}) endif(MSVC) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) @@ -106,11 +109,39 @@ include_directories( endif(WIN32) - target_link_libraries(Gradido_LoginServer ${CONAN_LIBS} ${IROHA_ED25519}) if(WIN32) TARGET_LINK_LIBRARIES(Gradido_LoginServer optimized ${MYSQL_LIBRARIES} Shlwapi) TARGET_LINK_LIBRARIES(Gradido_LoginServer debug ${COMPILED_MARIADB_CLIENT_DEBUG} Shlwapi) else(WIN32) target_link_libraries(Gradido_LoginServer libmariadb PocoNet PocoUtil PocoJSON PocoFoundation PocoData PocoNetSSL protoc protobuf -pthread) -endif(WIN32) \ No newline at end of file +endif(WIN32) + +enable_testing() + +# ---------------------- Test ----------------------------------------- +#project(Gradido_LoginServer_Test C CXX) +#_TEST_BUILD + + +add_executable(Gradido_LoginServer_Test ${LOCAL_SRCS} ${TEST}) +target_compile_definitions(Gradido_LoginServer_Test PUBLIC "_TEST_BUILD") + +target_link_libraries(Gradido_LoginServer_Test ${CONAN_LIBS} ${IROHA_ED25519}) +if(WIN32) + set(MYSQL_INCLUDE_DIR "dependencies/mariadb-connector-c/include") + TARGET_LINK_LIBRARIES(Gradido_LoginServer_Test optimized ${MYSQL_LIBRARIES} Shlwapi) + TARGET_LINK_LIBRARIES(Gradido_LoginServer_Test debug ${COMPILED_MARIADB_CLIENT_DEBUG} Shlwapi) +else(WIN32) + set(INSTALL_BINDIR "bin") + set(INSTALL_PLUGINDIR "bin") + add_subdirectory("dependencies/mariadb-connector-c") + + + include_directories( + "dependencies/mariadb-connector-c/include" + "build/dependencies/mariadb-connector-c/include" + ) + + target_link_libraries(Gradido_LoginServer_Test libmariadb PocoNet PocoUtil PocoJSON PocoFoundation PocoData PocoNetSSL protoc protobuf -pthread) +endif(WIN32) diff --git a/src/cpp/test/Test.cpp b/src/cpp/test/Test.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/src/cpp/test/Test.h b/src/cpp/test/Test.h new file mode 100644 index 000000000..e69de29bb diff --git a/src/cpp/test/TestSession.cpp b/src/cpp/test/TestSession.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/src/cpp/test/TestSession.h b/src/cpp/test/TestSession.h new file mode 100644 index 000000000..e69de29bb diff --git a/src/cpp/test/TestSessionManager.cpp b/src/cpp/test/TestSessionManager.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/src/cpp/test/TestSessionManager.h b/src/cpp/test/TestSessionManager.h new file mode 100644 index 000000000..e69de29bb diff --git a/src/cpp/test/TestTasks.cpp b/src/cpp/test/TestTasks.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/src/cpp/test/TestTasks.h b/src/cpp/test/TestTasks.h new file mode 100644 index 000000000..e69de29bb diff --git a/src/cpp/test/TestUser.cpp b/src/cpp/test/TestUser.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/src/cpp/test/TestUser.h b/src/cpp/test/TestUser.h new file mode 100644 index 000000000..e69de29bb diff --git a/src/cpp/test/main.cpp b/src/cpp/test/main.cpp new file mode 100644 index 000000000..5c254651e --- /dev/null +++ b/src/cpp/test/main.cpp @@ -0,0 +1,6 @@ + + +int main(int argc, char** argv) +{ + return 42; +} \ No newline at end of file diff --git a/src/cpp/test/main.h b/src/cpp/test/main.h new file mode 100644 index 000000000..e69de29bb