Dart.cmake 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. # - Configure a project for testing with CTest or old Dart Tcl Client
  2. # This file is the backwards-compatibility version of the CTest module.
  3. # It supports using the old Dart 1 Tcl client for driving dashboard
  4. # submissions as well as testing with CTest. This module should be included
  5. # in the CMakeLists.txt file at the top of a project. Typical usage:
  6. # INCLUDE(Dart)
  7. # IF(BUILD_TESTING)
  8. # # ... testing related CMake code ...
  9. # ENDIF(BUILD_TESTING)
  10. # The BUILD_TESTING option is created by the Dart module to determine
  11. # whether testing support should be enabled. The default is ON.
  12. # This file configures a project to use the Dart testing/dashboard process.
  13. # It is broken into 3 sections.
  14. #
  15. # Section #1: Locate programs on the client and determine site and build name
  16. # Section #2: Configure or copy Tcl scripts from the source tree to build tree
  17. # Section #3: Custom targets for performing dashboard builds.
  18. #
  19. #
  20. OPTION(BUILD_TESTING "Build the testing tree." ON)
  21. IF(BUILD_TESTING)
  22. FIND_PACKAGE(Dart QUIET)
  23. #
  24. # Section #1:
  25. #
  26. # CMake commands that will not vary from project to project. Locates programs
  27. # on the client and configure site name and build name.
  28. #
  29. SET(RUN_FROM_DART 1)
  30. INCLUDE(CTest)
  31. SET(RUN_FROM_DART)
  32. FIND_PROGRAM(COMPRESSIONCOMMAND NAMES gzip compress zip
  33. DOC "Path to program used to compress files for transfer to the dart server")
  34. FIND_PROGRAM(GUNZIPCOMMAND gunzip DOC "Path to gunzip executable")
  35. FIND_PROGRAM(JAVACOMMAND java DOC "Path to java command, used by the Dart server to create html.")
  36. OPTION(DART_VERBOSE_BUILD "Show the actual output of the build, or if off show a . for each 1024 bytes."
  37. OFF)
  38. OPTION(DART_BUILD_ERROR_REPORT_LIMIT "Limit of reported errors, -1 reports all." -1 )
  39. OPTION(DART_BUILD_WARNING_REPORT_LIMIT "Limit of reported warnings, -1 reports all." -1 )
  40. SET(VERBOSE_BUILD ${DART_VERBOSE_BUILD})
  41. SET(BUILD_ERROR_REPORT_LIMIT ${DART_BUILD_ERROR_REPORT_LIMIT})
  42. SET(BUILD_WARNING_REPORT_LIMIT ${DART_BUILD_WARNING_REPORT_LIMIT})
  43. SET (DELIVER_CONTINUOUS_EMAIL "Off" CACHE BOOL "Should Dart server send email when build errors are found in Continuous builds?")
  44. MARK_AS_ADVANCED(
  45. COMPRESSIONCOMMAND
  46. DART_BUILD_ERROR_REPORT_LIMIT
  47. DART_BUILD_WARNING_REPORT_LIMIT
  48. DART_TESTING_TIMEOUT
  49. DART_VERBOSE_BUILD
  50. DELIVER_CONTINUOUS_EMAIL
  51. GUNZIPCOMMAND
  52. JAVACOMMAND
  53. )
  54. SET(HAVE_DART)
  55. IF(EXISTS "${DART_ROOT}/Source/Client/Dart.conf.in")
  56. SET(HAVE_DART 1)
  57. ENDIF(EXISTS "${DART_ROOT}/Source/Client/Dart.conf.in")
  58. #
  59. # Section #2:
  60. #
  61. # Make necessary directories and configure testing scripts
  62. #
  63. # find a tcl shell command
  64. IF(HAVE_DART)
  65. FIND_PACKAGE(Tclsh)
  66. ENDIF(HAVE_DART)
  67. IF (HAVE_DART AND TCL_TCLSH)
  68. # make directories in the binary tree
  69. FILE(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/Testing/HTML/TestingResults/Dashboard"
  70. "${PROJECT_BINARY_DIR}/Testing/HTML/TestingResults/Sites/${SITE}/${BUILDNAME}")
  71. # configure files
  72. CONFIGURE_FILE(
  73. "${DART_ROOT}/Source/Client/Dart.conf.in"
  74. "${PROJECT_BINARY_DIR}/DartConfiguration.tcl" )
  75. #
  76. # Section 3:
  77. #
  78. # Custom targets to perform dashboard builds and submissions.
  79. # These should NOT need to be modified from project to project.
  80. #
  81. # add testing targets
  82. SET(DART_EXPERIMENTAL_NAME Experimental)
  83. IF(DART_EXPERIMENTAL_USE_PROJECT_NAME)
  84. SET(DART_EXPERIMENTAL_NAME "${DART_EXPERIMENTAL_NAME}${PROJECT_NAME}")
  85. ENDIF(DART_EXPERIMENTAL_USE_PROJECT_NAME)
  86. ADD_CUSTOM_TARGET(${DART_EXPERIMENTAL_NAME}
  87. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Start Update Configure Build Test)
  88. ADD_CUSTOM_TARGET(${DART_EXPERIMENTAL_NAME}Submit
  89. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Submit)
  90. # for non IDE based builds nmake and make
  91. # add all these extra targets
  92. IF(${CMAKE_MAKE_PROGRAM} MATCHES make)
  93. # Make targets for Experimental builds
  94. ADD_CUSTOM_TARGET(ExperimentalStart
  95. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Start)
  96. ADD_CUSTOM_TARGET(ExperimentalUpdate
  97. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Start Update)
  98. ADD_CUSTOM_TARGET(ExperimentalConfigure
  99. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Start Configure)
  100. ADD_CUSTOM_TARGET(ExperimentalBuild
  101. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Start Build)
  102. ADD_CUSTOM_TARGET(ExperimentalTest
  103. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Test)
  104. ADD_CUSTOM_TARGET(ExperimentalCoverage
  105. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Coverage)
  106. ADD_CUSTOM_TARGET(ExperimentalDashboardStart
  107. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental DashboardStart)
  108. ADD_CUSTOM_TARGET(ExperimentalDashboardEnd
  109. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental DashboardEnd)
  110. # Continuous
  111. ADD_CUSTOM_TARGET(Continuous
  112. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Start Update Configure Build Test Submit)
  113. ADD_CUSTOM_TARGET(ContinuousStart
  114. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Start)
  115. ADD_CUSTOM_TARGET(ContinuousUpdate
  116. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Update)
  117. ADD_CUSTOM_TARGET(ContinuousConfigure
  118. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Configure)
  119. ADD_CUSTOM_TARGET(ContinuousBuild
  120. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Build)
  121. ADD_CUSTOM_TARGET(ContinuousTest
  122. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Test)
  123. ADD_CUSTOM_TARGET(ContinuousCoverage
  124. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Coverage)
  125. ADD_CUSTOM_TARGET(ContinuousSubmit
  126. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Submit)
  127. # Nightly
  128. ADD_CUSTOM_TARGET(Nightly
  129. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Start Update Configure Build Test Submit)
  130. ADD_CUSTOM_TARGET(NightlyStart
  131. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Start)
  132. ADD_CUSTOM_TARGET(NightlyUpdate
  133. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Update)
  134. ADD_CUSTOM_TARGET(NightlyConfigure
  135. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Configure)
  136. ADD_CUSTOM_TARGET(NightlyBuild
  137. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Build)
  138. ADD_CUSTOM_TARGET(NightlyTest
  139. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Test)
  140. ADD_CUSTOM_TARGET(NightlyCoverage
  141. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Coverage)
  142. ADD_CUSTOM_TARGET(NightlySubmit
  143. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Submit)
  144. ADD_CUSTOM_TARGET(NightlyDashboardStart
  145. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly DashboardStart)
  146. ADD_CUSTOM_TARGET(NightlyDashboardEnd
  147. ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly DashboardEnd)
  148. ENDIF (${CMAKE_MAKE_PROGRAM} MATCHES make)
  149. ELSE(HAVE_DART AND TCL_TCLSH)
  150. SET(RUN_FROM_CTEST_OR_DART 1)
  151. INCLUDE(CTestTargets)
  152. SET(RUN_FROM_CTEST_OR_DART)
  153. ENDIF (HAVE_DART AND TCL_TCLSH)
  154. ENDIF(BUILD_TESTING)
  155. #
  156. # End of Dart.cmake
  157. #