CMakeLists.txt 780 B

12345678910111213141516171819202122232425262728
  1. cmake_minimum_required(VERSION 3.4)
  2. project(Server CXX)
  3. find_package(PythonInterp REQUIRED)
  4. macro(do_test bsname file type)
  5. execute_process(COMMAND ${PYTHON_EXECUTABLE}
  6. -B # no .pyc files
  7. "${CMAKE_SOURCE_DIR}/${type}-test.py"
  8. "${CMAKE_COMMAND}"
  9. "${CMAKE_SOURCE_DIR}/${file}"
  10. "${CMAKE_SOURCE_DIR}"
  11. "${CMAKE_BINARY_DIR}"
  12. "${CMAKE_GENERATOR}"
  13. RESULT_VARIABLE test_result
  14. )
  15. if (NOT test_result EQUAL 0)
  16. message(SEND_ERROR "TEST FAILED: ${test_result}")
  17. endif()
  18. endmacro()
  19. do_test("test_cache" "tc_cache.json" "server")
  20. do_test("test_handshake" "tc_handshake.json" "server")
  21. do_test("test_globalSettings" "tc_globalSettings.json" "server")
  22. do_test("test_buildsystem1" "tc_buildsystem1.json" "server")
  23. add_executable(Server empty.cpp)