mirror of
https://github.com/eclipse-openvehicle-api/openvehicle-api.git
synced 2026-07-02 05:35:11 +00:00
20
tests/unit_tests/app_connect/CMakeLists.txt
Normal file
20
tests/unit_tests/app_connect/CMakeLists.txt
Normal file
@@ -0,0 +1,20 @@
|
||||
# Define project
|
||||
project (UnitTest_App_Connect VERSION 1.0 LANGUAGES CXX)
|
||||
|
||||
# Compile the source code
|
||||
add_executable(UnitTest_App_Connect
|
||||
"main.cpp"
|
||||
"app_connect_local.cpp")
|
||||
target_link_libraries(UnitTest_App_Connect ${CMAKE_DL_LIBS} GTest::GTest)
|
||||
|
||||
# Add the IDL Compiler unittest
|
||||
add_test(NAME UnitTest_App_Connect COMMAND UnitTest_App_Connect)
|
||||
|
||||
# Execute the test
|
||||
add_custom_command(TARGET UnitTest_App_Connect POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E env TEST_EXECUTION_MODE=CMake "$<TARGET_FILE:UnitTest_App_Connect>" --gtest_output=xml:${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/UnitTest_App_Connect.xml
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
# Build dependencies
|
||||
add_dependencies(UnitTest_App_Connect dependency_sdv_components)
|
||||
7
tests/unit_tests/app_connect/app_connect_local.cpp
Normal file
7
tests/unit_tests/app_connect/app_connect_local.cpp
Normal file
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
- Default instantiate listener
|
||||
- Instantiate with specific info
|
||||
- Multiple instantiate with identical info (failure)
|
||||
- Multiple instantiate with different info
|
||||
- Default instantiate client and get connection information
|
||||
- */
|
||||
19
tests/unit_tests/app_connect/main.cpp
Normal file
19
tests/unit_tests/app_connect/main.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include "../../../global/process_watchdog.h"
|
||||
#include "../../../global/localmemmgr.h"
|
||||
|
||||
/**
|
||||
* @brief Main function
|
||||
*/
|
||||
#if defined(_WIN32) && defined(_UNICODE)
|
||||
extern "C" int wmain(int argc, wchar_t* argv[])
|
||||
#else
|
||||
extern "C" int main(int argc, char* argv[])
|
||||
#endif
|
||||
{
|
||||
CProcessWatchdog watchdog;
|
||||
|
||||
CLocalMemMgr memmgr;
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
||||
Reference in New Issue
Block a user