This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  57eb391335197a75d92530bfcd67ea4087d98066 (commit)
       via  236d0c878cccdcaf5fd49c790c65340fb89a92a7 (commit)
       via  ffa49bcc1163e22489e67d4204d6371fd68372e5 (commit)
      from  b49af13bc15f01dd45f05c331e79d56dbd185d09 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=57eb391335197a75d92530bfcd67ea4087d98066
commit 57eb391335197a75d92530bfcd67ea4087d98066
Merge: b49af13 236d0c8
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Thu Jan 15 16:25:56 2015 -0500
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Thu Jan 15 16:25:56 2015 -0500

    Merge topic 'cdash_upload_file_mode' into next
    
    236d0c87 rename and rework CTestGCOV.cmake to CTestCoverageCollectGCOV.cmake
    ffa49bcc Fail and return when the upload file does not exist.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=236d0c878cccdcaf5fd49c790c65340fb89a92a7
commit 236d0c878cccdcaf5fd49c790c65340fb89a92a7
Author:     Bill Hoffman <bill.hoff...@kitware.com>
AuthorDate: Thu Jan 15 15:37:45 2015 -0500
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Thu Jan 15 16:03:23 2015 -0500

    rename and rework CTestGCOV.cmake to CTestCoverageCollectGCOV.cmake
    
    This creates the function ctest_coverage_collect_gcov.

diff --git a/Help/manual/cmake-modules.7.rst b/Help/manual/cmake-modules.7.rst
index d96b96f..965eede 100644
--- a/Help/manual/cmake-modules.7.rst
+++ b/Help/manual/cmake-modules.7.rst
@@ -63,7 +63,7 @@ All Modules
    /module/CPack
    /module/CPackWIX
    /module/CTest
-   /module/CTestGCOV
+   /module/CTestCoverageCollectGCOV
    /module/CTestScriptMode
    /module/CTestUseLaunchers
    /module/Dart
diff --git a/Help/module/CTestCoverageCollectGCOV.rst 
b/Help/module/CTestCoverageCollectGCOV.rst
new file mode 100644
index 0000000..4c5deca
--- /dev/null
+++ b/Help/module/CTestCoverageCollectGCOV.rst
@@ -0,0 +1 @@
+.. cmake-module:: ../../Modules/CTestCoverageCollectGCOV.cmake
diff --git a/Help/module/CTestGCOV.rst b/Help/module/CTestGCOV.rst
deleted file mode 100644
index b1077fe..0000000
--- a/Help/module/CTestGCOV.rst
+++ /dev/null
@@ -1 +0,0 @@
-.. cmake-module:: ../../Modules/CTestGCOV.cmake
diff --git a/Modules/CTestCoverageCollectGCOV.cmake 
b/Modules/CTestCoverageCollectGCOV.cmake
new file mode 100644
index 0000000..551fbd0
--- /dev/null
+++ b/Modules/CTestCoverageCollectGCOV.cmake
@@ -0,0 +1,122 @@
+#.rst:
+# CTestCoverageCollectGCOV
+# ------------------------
+#
+# This module provides the function ``ctest_coverage_collect_gcov``.
+# The function will run gcov on the .gcda files in a binary tree and then
+# package all of the .gcov files into a tar file with a data.json.
+# This file can be sent to a CDash server for display with the
+# :command:`ctest_submit(CDASH_UPLOAD)` command.
+#
+# .. command:: cdash_coverage_collect_gcov
+#
+#   ::
+#
+#     ctest_coverage_collect_gcov(
+#           TARBALL <tarfile> # required
+#           SOURCE <source_dir> # optional, else CTEST_SOURCE_DIRECTORY
+#           BUILD <build_dir> # optional, else CTEST_BINARY_DIRECTORY
+#           GCOV_COMMAND <gcov_command> # optional, else CTEST_COVERAGE_COMMAND
+#     )
+#
+#   Run gcov and package a tar file for cdash. ``<tarfile>`` is the name
+#   of the tarfile that is created and it will be placed in ``<binary_dir>``.
+#   ``<source_dir>`` is the source directory for the build and ``<binary_dir>``
+#   is the binary directory for the build. The ``<gcov_command>`` is a full
+#   path to ``gcov`` for the machine.
+
+#=============================================================================
+# Copyright 2014-2015 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+#  License text for the above reference.)
+include(CMakeParseArguments)
+function(ctest_coverage_collect_gcov)
+  set(options "")
+  set(oneValueArgs TARBALL SOURCE BUILD GCOV_COMMAND)
+  set(multiValueArgs "")
+  cmake_parse_arguments(GCOV  "${options}" "${oneValueArgs}"
+    "${multiValueArgs}" "" ${ARGN} )
+  if(NOT DEFINED GCOV_TARBALL)
+    message(FATAL_ERROR
+      "TARBALL must be specified. for ctest_coverage_collect_gcov")
+  endif()
+  if(NOT DEFINED GCOV_SOURCE)
+    set(source_dir "${CTEST_SOURCE_DIRECTORY}")
+  else()
+    set(source_dir "${GCOV_SOURCE}")
+  endif()
+  if(NOT DEFINED GCOV_BUILD)
+    set(binary_dir "${CTEST_BINARY_DIRECTORY}")
+  else()
+    set(binary_dir "${GCOV_BUILD}")
+  endif()
+  if(NOT DEFINED GCOV_GCOV_COMMAND)
+    set(gcov_command "${CTEST_COVERAGE_COMMAND}")
+  else()
+    set(gcov_command "${GCOV_GCOV_COMMAND}")
+  endif()
+  # run gcov on each gcda file in the binary tree
+  set(gcda_files)
+  set(label_files)
+  # look for gcda files in the target directories
+  # could do a glob from the top of the binary tree but
+  # this will be faster and only look where the files will be
+  file(STRINGS "${binary_dir}/CMakeFiles/TargetDirectories.txt" target_dirs)
+  foreach(target_dir ${target_dirs})
+    file(GLOB_RECURSE gfiles RELATIVE ${binary_dir} "${target_dir}/*.gcda")
+    list(LENGTH gfiles len)
+    # if we have gcda files then also grab the labels file for that target
+    if(${len} GREATER 0)
+      file(GLOB_RECURSE lfiles RELATIVE ${binary_dir}
+        "${target_dir}/Labels.txt")
+      list(APPEND gcda_files ${gfiles})
+      list(APPEND label_files ${lfiles})
+    endif()
+  endforeach()
+  # return early if no coverage files were found
+  list(LENGTH gcda_files len)
+  if(len EQUAL 0)
+    message("ctest_coverage_collect_gcov: No .gcda files found, "
+      "ignoring coverage request.")
+    return()
+  endif()
+  # setup the dir for the coverage files
+  set(coverage_dir "${binary_dir}/Testing/CoverageInfo")
+  file(MAKE_DIRECTORY  "${coverage_dir}")
+  # call gcov on each .gcda file
+  foreach (gcda_file ${gcda_files})
+    # get the directory of the gcda file
+    get_filename_component(gcov_dir ${gcda_file} DIRECTORY)
+    # run gcov, this will produce the .gcov file in the current
+    # working directory
+    execute_process(COMMAND
+      ${gcov_command} -b -o ${gcov_dir} ${gcda_file}
+      OUTPUT_VARIABLE out
+      WORKING_DIRECTORY ${coverage_dir})
+  endforeach()
+  # create json file with project information
+  file(WRITE ${coverage_dir}/data.json
+    "{
+    \"Source\": \"${source_dir}\",
+    \"Binary\": \"${binary_dir}\"
+}")
+  # collect the gcov files
+  set(gcov_files)
+  file(GLOB_RECURSE gcov_files RELATIVE ${binary_dir} "${binary_dir}/*.gcov")
+  # tar up the coverage info with the same date so that the md5
+  # sum will be the same for the tar file independent of file time
+  # stamps
+  execute_process(COMMAND
+    ${CMAKE_COMMAND} -E tar cvf ${GCOV_TARBALL}
+    --mtime=1970-01-01\ 0:0:0\ UTC ${gcov_files}
+    ${coverage_dir}/data.json  ${label_files}
+    WORKING_DIRECTORY ${binary_dir})
+endfunction()
diff --git a/Modules/CTestGCOV.cmake b/Modules/CTestGCOV.cmake
deleted file mode 100644
index f505159..0000000
--- a/Modules/CTestGCOV.cmake
+++ /dev/null
@@ -1,72 +0,0 @@
-#.rst:
-# CTestGCOV
-# ---------
-#
-# This module provides the function ``run_gcov_and_package_for_cdash``.
-# The function will run gcov on the .gcda files in a binary tree and then
-# package all of the .gcov files into a tar file with a data.json.
-# This file can be sent to a CDash server for display with the
-# :command:`ctest_submit(CDASH_UPLOAD)` command.
-#
-# .. command:: run_gcov_and_package_for_cdash
-#
-#   ::
-#
-#     run_gcov_and_package_for_cdash(<tarfile> <source_dir> <binary_dir>
-#                                    <gcov_command>)
-#
-#   Run gcov and package a tar gz file for cdash. ``<tarfile>`` is the name
-#   of the tarfile that is created and it will be placed in ``<binary_dir>``.
-#   ``<source_dir>`` is the source directory for the build and ``<binary_dir>``
-#   is the binary directory for the build. The ``<gcov_command>`` is a full
-#   path to ``gcov`` for the machine.
-
-#=============================================================================
-# Copyright 2014-2015 Kitware, Inc.
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-#  License text for the above reference.)
-
-function(run_gcov_and_package_for_cdash tarfile source_dir binary_dir
-    gcov_command)
-  # run gcov on each gcda file in the binary tree
-  file(GLOB_RECURSE GCDA_FILES RELATIVE  ${binary_dir} "*.gcda")
-
-  # return early if no coverage files were found
-  list(LENGTH GCDA_FILES len)
-  if(len EQUAL 0)
-    message("CTestGCOV: No .gcda files found, ignoring coverage request.")
-    return()
-  endif()
-
-  foreach (gcda_file ${GCDA_FILES})
-    # get the directory of the gcda file
-    get_filename_component(gcov_dir ${gcda_file} DIRECTORY)
-    # run gcov
-    execute_process(COMMAND
-      ${gcov_command} -b -o ${gcov_dir} ${gcda_file}
-      OUTPUT_VARIABLE out
-      WORKING_DIRECTORY ${binary_dir})
-  endforeach()
-  # create json file with project information
-  file(WRITE ${binary_dir}/data.json
-    "{
-    \"Source\": \"${source_dir}\",
-    \"Binary\": \"${binary_dir}\"
-}"
-    )
-  # collect the gcov files
-  file(GLOB_RECURSE gcov_files RELATIVE ${binary_dir} "*.gcov")
-  # tar up the coverage info
-  execute_process(COMMAND
-    ${CMAKE_COMMAND} -E tar cvf ${tarfile}
-    --mtime=1970-01-01\ 0:0:0\ UTC ${gcov_files} data.json
-    WORKING_DIRECTORY ${binary_dir})
-endfunction()

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ffa49bcc1163e22489e67d4204d6371fd68372e5
commit ffa49bcc1163e22489e67d4204d6371fd68372e5
Author:     Bill Hoffman <bill.hoff...@kitware.com>
AuthorDate: Thu Jan 15 15:40:10 2015 -0500
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Thu Jan 15 16:03:22 2015 -0500

    Fail and return when the upload file does not exist.

diff --git a/Source/CTest/cmCTestSubmitHandler.cxx 
b/Source/CTest/cmCTestSubmitHandler.cxx
index 3e5fa38..53a8982 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -1088,6 +1088,7 @@ int 
cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE,
                "Upload file not found: " << file << "\n");
+    return -1;
     }
   cmCTestCurl curl(this->CTest);
   std::string curlopt(this->CTest->GetCTestConfiguration("CurlOptions"));

-----------------------------------------------------------------------

Summary of changes:
 Help/manual/cmake-modules.7.rst          |    2 +-
 Help/module/CTestCoverageCollectGCOV.rst |    1 +
 Help/module/CTestGCOV.rst                |    1 -
 Modules/CTestCoverageCollectGCOV.cmake   |  122 ++++++++++++++++++++++++++++++
 Modules/CTestGCOV.cmake                  |   72 ------------------
 Source/CTest/cmCTestSubmitHandler.cxx    |    1 +
 6 files changed, 125 insertions(+), 74 deletions(-)
 create mode 100644 Help/module/CTestCoverageCollectGCOV.rst
 delete mode 100644 Help/module/CTestGCOV.rst
 create mode 100644 Modules/CTestCoverageCollectGCOV.cmake
 delete mode 100644 Modules/CTestGCOV.cmake


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/mailman/listinfo/cmake-commits

Reply via email to