CMakeLists.txt 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. include(${QT_PROTOBUF_CMAKE_DIR}/QtProtobufTest.cmake)
  2. # clients
  3. add_test_target(TARGET qtgrpc_test
  4. SOURCES clienttest.cpp QML)
  5. add_target_windeployqt(TARGET qtgrpc_test
  6. QML_DIR ${CMAKE_CURRENT_SOURCE_DIR})
  7. add_test_target(TARGET qtgrpc_secure_test
  8. SOURCES sslclienttest.cpp)
  9. add_target_windeployqt(TARGET qtgrpc_secure_test
  10. QML_DIR ${CMAKE_CURRENT_SOURCE_DIR})
  11. if (QT_PROTOBUF_NATIVE_GRPC_CHANNEL)
  12. target_compile_definitions(qtgrpc_test PRIVATE QT_PROTOBUF_NATIVE_GRPC_CHANNEL)
  13. target_compile_definitions(qtgrpc_secure_test PRIVATE QT_PROTOBUF_NATIVE_GRPC_CHANNEL)
  14. endif()
  15. # servers
  16. add_subdirectory(echoserver)
  17. add_subdirectory(secureechoserver)
  18. configure_file(${CMAKE_CURRENT_SOURCE_DIR}/testfile ${CMAKE_CURRENT_BINARY_DIR}/testfile COPYONLY)
  19. if(UNIX)
  20. set(TEST_DRIVER_NAME "test_driver.sh")
  21. elseif(WIN32)
  22. set(TEST_DRIVER_NAME "test_driver.bat")
  23. endif()
  24. configure_file(${TEST_DRIVER_NAME}.in ${TEST_DRIVER_NAME} @ONLY)
  25. add_test(NAME qtgrpc_echo_test
  26. COMMAND ${TEST_DRIVER_NAME} $<TARGET_FILE:qtgrpc_test> $<TARGET_FILE:echoserver> $<TARGET_FILE_NAME:qtgrpc_test> $<TARGET_FILE_NAME:echoserver>
  27. )
  28. add_test(NAME qtgrpc_secure_test
  29. COMMAND ${TEST_DRIVER_NAME} $<TARGET_FILE:qtgrpc_secure_test> $<TARGET_FILE:secureechoserver> $<TARGET_FILE_NAME:qtgrpc_secure_test> $<TARGET_FILE_NAME:secureechoserver>
  30. )