CMakeLists.txt 1.2 KB

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