You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

137 lines
4.1 KiB

  1. # Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  2. #
  3. # This program is free software; you can redistribute it and/or modify
  4. # it under the terms of the GNU General Public License as published by
  5. # the Free Software Foundation; version 2 of the License.
  6. #
  7. # This program is distributed in the hope that it will be useful,
  8. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. # GNU General Public License for more details.
  11. #
  12. # You should have received a copy of the GNU General Public License
  13. # along with this program; if not, write to the Free Software
  14. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  15. IF(INSTALL_MYSQLTESTDIR)
  16. INSTALL(
  17. DIRECTORY .
  18. DESTINATION ${INSTALL_MYSQLTESTDIR}
  19. USE_SOURCE_PERMISSIONS
  20. COMPONENT Test
  21. PATTERN "var/" EXCLUDE
  22. PATTERN "lib/My/SafeProcess" EXCLUDE
  23. PATTERN "lib/t*" EXCLUDE
  24. PATTERN "CPack" EXCLUDE
  25. PATTERN "CMake*" EXCLUDE
  26. PATTERN "mtr.out*" EXCLUDE
  27. PATTERN ".cvsignore" EXCLUDE
  28. PATTERN "*.am" EXCLUDE
  29. PATTERN "*.in" EXCLUDE
  30. PATTERN "*.vcproj" EXCLUDE
  31. PATTERN "*.vcxproj" EXCLUDE
  32. PATTERN "*.vcxproj.*" EXCLUDE
  33. )
  34. ENDIF()
  35. IF(NOT ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
  36. # Enable running mtr from build directory
  37. CONFIGURE_FILE(
  38. ${CMAKE_CURRENT_SOURCE_DIR}/mtr.out-of-source
  39. ${CMAKE_CURRENT_BINARY_DIR}/mysql-test-run.pl
  40. @ONLY
  41. )
  42. ENDIF()
  43. IF(UNIX)
  44. EXECUTE_PROCESS(
  45. COMMAND chmod +x mysql-test-run.pl
  46. COMMAND ${CMAKE_COMMAND} -E create_symlink
  47. ./mysql-test-run.pl mtr
  48. COMMAND ${CMAKE_COMMAND} -E create_symlink
  49. ./mysql-test-run.pl mysql-test-run
  50. WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
  51. )
  52. IF(INSTALL_MYSQLTESTDIR)
  53. INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mtr
  54. ${CMAKE_CURRENT_BINARY_DIR}/mysql-test-run
  55. DESTINATION ${INSTALL_MYSQLTESTDIR}
  56. COMPONENT Test)
  57. ENDIF()
  58. ENDIF()
  59. IF(CMAKE_GENERATOR MATCHES "Visual Studio")
  60. SET(SETCONFIG_COMMAND set MTR_VS_CONFIG=${CMAKE_CFG_INTDIR})
  61. ELSEIF(CMAKE_GENERATOR MATCHES "Xcode")
  62. SET(SETCONFIG_COMMAND export MTR_VS_CONFIG=${CMAKE_CFG_INTDIR})
  63. ELSE()
  64. SET(SETCONFIG_COMMAND echo Running tests)
  65. ENDIF()
  66. IF(CYGWIN)
  67. # On cygwin, pretend to be "Unix" system
  68. SET(SETOS_COMMAND export MTR_CYGWIN_IS_UNIX=1)
  69. ELSE()
  70. SET(SETOS_COMMAND echo OS=${CMAKE_SYSTEM_NAME})
  71. ENDIF()
  72. SET(EXP --experimental=collections/default.experimental)
  73. IF(WIN32)
  74. SET(SET_ENV set)
  75. ELSE()
  76. SET(SET_ENV export)
  77. ENDIF()
  78. SET(MTR_FORCE perl ./mysql-test-run.pl --force)
  79. IF(EXISTS ${CMAKE_SOURCE_DIR}/mysql-test/suite/nist)
  80. SET(TEST_NIST ${MTR_FORCE} --comment=nist suite=nist ${EXP} &&
  81. ${MTR_FORCE} --comment=nist --force --suite=nist+ps ${EXP})
  82. ELSE()
  83. SET(TEST_NIST echo "NIST tests not found")
  84. ENDIF()
  85. IF(WITH_EMBEDDED_SERVER)
  86. SET(TEST_EMBEDDED ${MTR_FORCE} --comment=embedded --timer --embedded-server
  87. --skip-rpl --skip-ndbcluster $(EXP))
  88. ELSE()
  89. SET(TEST_EMBEDDED echo "Can not test embedded, not compiled in")
  90. ENDIF()
  91. SET(TEST_BT_START
  92. COMMAND ${SETCONFIG_COMMAND}
  93. COMMAND ${SETOS_COMMAND}
  94. COMMAND ${SET_ENV} MTR_BUILD_THREAD=auto
  95. )
  96. ADD_CUSTOM_TARGET(test-force
  97. ${TEST_BT_START}
  98. COMMAND ${MTR_FORCE}
  99. )
  100. ADD_CUSTOM_TARGET(test-bt
  101. ${TEST_BT_START}
  102. COMMAND ${MTR_FORCE} --comment=normal --timer --skip-ndbcluster --report-features ${EXP}
  103. COMMAND ${MTR_FORCE} --comment=ps --timer --skip-ndbcluster --ps-protocol ${EXP}
  104. COMMAND ${MTR_FORCE} --comment=funcs1+ps --ps-protocol --reorder --suite=funcs_1 ${EXP}
  105. COMMAND ${MTR_FORCE} --comment=funcs2 --suite=funcs_2 ${EXP}
  106. COMMAND ${MTR_FORCE} --comment=partitions --suite=parts ${EXP}
  107. COMMAND ${MTR_FORCE} --comment=stress --suite=stress ${EXP}
  108. COMMAND ${MTR_FORCE} --force --comment=jp --suite=jp ${EXP}
  109. COMMAND ${TEST_NIST}
  110. COMMAND ${TEST_EMBEDDED}
  111. )
  112. ADD_CUSTOM_TARGET(test-bt-fast
  113. ${TEST_BT_START}
  114. COMMAND ${MTR_FORCE} --comment=ps --timer --skip-ndbcluster --ps-protocol --report-features ${EXP}
  115. COMMAND ${MTR_FORCE} --comment=stress --suite=stress ${EXP}
  116. )
  117. ADD_CUSTOM_TARGET(test-bt-debug
  118. ${TEST_BT_START}
  119. COMMAND ${MTR_FORCE} --comment=debug --timer --skip-ndbcluster --skip-rpl --report-features ${EXP}
  120. )