[Cmake-commits] CMake branch, next, updated. v3.1.1-2554-g062cb2f

Brad King brad.king at kitware.com
Tue Feb 3 10:41:22 EST 2015


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  062cb2f5d0c7ab90f04805207bf4bef6469764d3 (commit)
       via  03c0812c41d4db2a48687ce0c053452906dfe69f (commit)
       via  8caa4e72abe4393914f4dcefd1621d3c86a7d139 (commit)
       via  5c828cc89b4f78eceaf0402719cf5693a6627935 (commit)
       via  30cb628ecb31484015136bf6065c9c40f59a9297 (commit)
      from  0539d927c370a25e09b59e8fb90e382cae13a224 (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=062cb2f5d0c7ab90f04805207bf4bef6469764d3
commit 062cb2f5d0c7ab90f04805207bf4bef6469764d3
Merge: 0539d92 03c0812
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Feb 3 10:41:21 2015 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Feb 3 10:41:21 2015 -0500

    Merge topic 'CTestCoverageCollectGCOV-refinements' into next
    
    03c0812c CTestCoverageCollectGCOV: Fix handling of international characters
    8caa4e72 CTestCoverageCollectGCOV: Add test case
    5c828cc8 CTestCoverageCollectGCOV: Allow custom flags to gcov
    30cb628e CTestCoverageCollectGCOV: Fix handling of large file counts


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=03c0812c41d4db2a48687ce0c053452906dfe69f
commit 03c0812c41d4db2a48687ce0c053452906dfe69f
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Feb 3 10:36:17 2015 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Feb 3 10:40:58 2015 -0500

    CTestCoverageCollectGCOV: Fix handling of international characters
    
    When loading the list of target support directories, read the file
    with UTF-8 encoding since that is what CMake writes into the file.
    This allows us to support international characters in the path to
    the build tree containing the target support directories.

diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake
index dd10e83..a607c52 100644
--- a/Modules/CTestCoverageCollectGCOV.cmake
+++ b/Modules/CTestCoverageCollectGCOV.cmake
@@ -90,7 +90,8 @@ function(ctest_coverage_collect_gcov)
   # 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)
+  file(STRINGS "${binary_dir}/CMakeFiles/TargetDirectories.txt" target_dirs
+       ENCODING UTF-8)
   foreach(target_dir ${target_dirs})
     file(GLOB_RECURSE gfiles RELATIVE ${binary_dir} "${target_dir}/*.gcda")
     list(LENGTH gfiles len)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8caa4e72abe4393914f4dcefd1621d3c86a7d139
commit 8caa4e72abe4393914f4dcefd1621d3c86a7d139
Author:     Bill Hoffman <bill.hoffman at kitware.com>
AuthorDate: Wed Jan 28 17:08:41 2015 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Feb 3 10:40:58 2015 -0500

    CTestCoverageCollectGCOV: Add test case

diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 3aecd9b..1a79854 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -2269,6 +2269,18 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
     PASS_REGULAR_EXPRESSION "Upload\\.xml")
 
   configure_file(
+    "${CMake_SOURCE_DIR}/Tests/CTestCoverageCollectGCOV/test.cmake.in"
+    "${CMake_BINARY_DIR}/Tests/CTestCoverageCollectGCOV/test.cmake"
+    @ONLY ESCAPE_QUOTES)
+  add_test(CTestCoverageCollectGCOV ${CMAKE_CTEST_COMMAND}
+    -S "${CMake_BINARY_DIR}/Tests/CTestCoverageCollectGCOV/test.cmake" -VV
+    --output-log "${CMake_BINARY_DIR}/Tests/CTestCoverageCollectGCOV/testOut.log"
+    )
+  set_tests_properties(CTestCoverageCollectGCOV PROPERTIES
+    PASS_REGULAR_EXPRESSION
+    "PASSED with correct output.*Testing/CoverageInfo/echoargs.gcov")
+
+  configure_file(
     "${CMake_SOURCE_DIR}/Tests/CTestTestEmptyBinaryDirectory/test.cmake.in"
     "${CMake_BINARY_DIR}/Tests/CTestTestEmptyBinaryDirectory/test.cmake"
     @ONLY ESCAPE_QUOTES)
diff --git a/Tests/CTestCoverageCollectGCOV/fakegcov.cmake b/Tests/CTestCoverageCollectGCOV/fakegcov.cmake
new file mode 100644
index 0000000..e704f14
--- /dev/null
+++ b/Tests/CTestCoverageCollectGCOV/fakegcov.cmake
@@ -0,0 +1,8 @@
+foreach(I RANGE 0 ${CMAKE_ARGC})
+  if("${CMAKE_ARGV${I}}" MATCHES ".*\\.gcda")
+    set(gcda_file "${CMAKE_ARGV${I}}")
+  endif()
+endforeach()
+get_filename_component(gcda_file ${gcda_file} NAME_WE)
+file(WRITE "${CMAKE_SOURCE_DIR}/${gcda_file}.gcov"
+"fake gcov file")
diff --git a/Tests/CTestCoverageCollectGCOV/test.cmake.in b/Tests/CTestCoverageCollectGCOV/test.cmake.in
new file mode 100644
index 0000000..4bdcb10
--- /dev/null
+++ b/Tests/CTestCoverageCollectGCOV/test.cmake.in
@@ -0,0 +1,39 @@
+cmake_minimum_required(VERSION 2.8.12)
+set(CTEST_PROJECT_NAME "SmallAndFast")
+set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTest/SmallAndFast")
+set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestCoverageCollectGCOV")
+set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@")
+ctest_start(Experimental)
+ctest_configure()
+ctest_build()
+ctest_test()
+
+file(WRITE ${CTEST_BINARY_DIRECTORY}/CMakeFiles/echoargs.dir/echoargs.gcda
+"dummy
+")
+
+include(CTestCoverageCollectGCOV)
+set(tar_file ${CTEST_BINARY_DIRECTORY}/gcov.tar)
+ctest_coverage_collect_gcov(
+  TARBALL "${tar_file}"
+  SOURCE "${CTEST_SOURCE_DIRECTORY}"
+  BUILD "${CTEST_BINARY_DIRECTORY}"
+  GCOV_COMMAND "${CMAKE_COMMAND}"
+  GCOV_OPTIONS -P "@CMake_SOURCE_DIR@/Tests/CTestCoverageCollectGCOV/fakegcov.cmake")
+
+execute_process(COMMAND
+      ${CMAKE_COMMAND} -E tar tf ${tar_file}
+      OUTPUT_VARIABLE out
+      WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
+
+set(expected_out
+"Testing/CoverageInfo/echoargs.gcov
+Testing/CoverageInfo/data.json
+CMakeFiles/echoargs.dir/Labels.json
+")
+
+if("${out}" STREQUAL "${expected_out}")
+  message("PASSED with correct output: ${out}")
+else()
+  message(FATAL_ERROR "FAILED: expected:\n${expected_out}\nGot:\n${out}")
+endif()

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5c828cc89b4f78eceaf0402719cf5693a6627935
commit 5c828cc89b4f78eceaf0402719cf5693a6627935
Author:     Bill Hoffman <bill.hoffman at kitware.com>
AuthorDate: Wed Jan 28 17:08:41 2015 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Feb 3 10:40:58 2015 -0500

    CTestCoverageCollectGCOV: Allow custom flags to gcov
    
    Add a GCOV_OPTIONS option to allow specification of custom flags.  In
    ctest_coverage gcov support, if you set CTEST_COVERAGE_EXTRA_FLAGS, they
    get put on the command line before the -o.  In this case we remove the
    -b and replace it with GCOV_OPTIONS.  All other arguments remain the
    same.

diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake
index f8058cd..dd10e83 100644
--- a/Modules/CTestCoverageCollectGCOV.cmake
+++ b/Modules/CTestCoverageCollectGCOV.cmake
@@ -19,6 +19,7 @@
 #     ctest_coverage_collect_gcov(TARBALL <tarfile>
 #       [SOURCE <source_dir>][BUILD <build_dir>]
 #       [GCOV_COMMAND <gcov_command>]
+#       [GCOV_OPTIONS <options>...]
 #       )
 #
 #   Run gcov and package a tar file for CDash.  The options are:
@@ -39,6 +40,11 @@
 #   ``GCOV_COMMAND <gcov_command>``
 #     Specify the full path to the ``gcov`` command on the machine.
 #     Default is the value of :variable:`CTEST_COVERAGE_COMMAND`.
+#
+#   ``GCOV_OPTIONS <options>...``
+#     Specify options to be passed to gcov.  The ``gcov`` command
+#     is run as ``gcov <options>... -o <gcov-dir> <file>.gcda``.
+#     If not specified, the default option is just ``-b``.
 
 #=============================================================================
 # Copyright 2014-2015 Kitware, Inc.
@@ -56,7 +62,7 @@ include(CMakeParseArguments)
 function(ctest_coverage_collect_gcov)
   set(options "")
   set(oneValueArgs TARBALL SOURCE BUILD GCOV_COMMAND)
-  set(multiValueArgs "")
+  set(multiValueArgs GCOV_OPTIONS)
   cmake_parse_arguments(GCOV  "${options}" "${oneValueArgs}"
     "${multiValueArgs}" "" ${ARGN} )
   if(NOT DEFINED GCOV_TARBALL)
@@ -113,11 +119,18 @@ function(ctest_coverage_collect_gcov)
     get_filename_component(gcov_dir ${gcda_file} DIRECTORY)
     # run gcov, this will produce the .gcov file in the current
     # working directory
+    if(NOT DEFINED GCOV_GCOV_OPTIONS)
+      set(GCOV_GCOV_OPTIONS -b)
+    endif()
     execute_process(COMMAND
-      ${gcov_command} -b -o ${gcov_dir} ${gcda_file}
+      ${gcov_command} ${GCOV_GCOV_OPTIONS} -o ${gcov_dir} ${gcda_file}
       OUTPUT_VARIABLE out
+      RESULT_VARIABLE res
       WORKING_DIRECTORY ${coverage_dir})
   endforeach()
+  if(NOT "${res}" EQUAL 0)
+    message(STATUS "Error running gcov: ${res} ${out}")
+  endif()
   # create json file with project information
   file(WRITE ${coverage_dir}/data.json
     "{

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=30cb628ecb31484015136bf6065c9c40f59a9297
commit 30cb628ecb31484015136bf6065c9c40f59a9297
Author:     Bill Hoffman <bill.hoffman at kitware.com>
AuthorDate: Wed Jan 28 17:08:41 2015 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Feb 3 10:40:53 2015 -0500

    CTestCoverageCollectGCOV: Fix handling of large file counts
    
    Use the --files-from option to tar to handle lots of files.

diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake
index f6616e0..f8058cd 100644
--- a/Modules/CTestCoverageCollectGCOV.cmake
+++ b/Modules/CTestCoverageCollectGCOV.cmake
@@ -130,9 +130,16 @@ function(ctest_coverage_collect_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
+  string(REPLACE ";" "\n" gcov_files "${gcov_files}")
+  string(REPLACE ";" "\n" label_files "${label_files}")
+  file(WRITE "${coverage_dir}/coverage_file_list.txt"
+    "${gcov_files}
+${coverage_dir}/data.json
+${label_files}
+")
   execute_process(COMMAND
     ${CMAKE_COMMAND} -E tar cvfj ${GCOV_TARBALL}
-    "--mtime=1970-01-01 0:0:0 UTC" ${gcov_files}
-    ${coverage_dir}/data.json  ${label_files}
+    "--mtime=1970-01-01 0:0:0 UTC"
+    --files-from=${coverage_dir}/coverage_file_list.txt
     WORKING_DIRECTORY ${binary_dir})
 endfunction()

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list