qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject [11/31] qpid-proton git commit: PROTON-1622 Add coverage reporting to CMake build
Date Wed, 15 Nov 2017 21:05:35 GMT
PROTON-1622 Add coverage reporting to CMake build

    cmake -DCMAKE_BUILD_TYPE=Coverage && make && ctest && make coverage

Then browse ${CMAKE_BUILD_DIR}/coverage_results/html/index.html


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/bdfe982f
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/bdfe982f
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/bdfe982f

Branch: refs/heads/go1
Commit: bdfe982f5f2dd8b9735288623fbc8eabe4a5371f
Parents: e170889
Author: Jiri Danek <jdanek@redhat.com>
Authored: Tue Oct 10 21:57:30 2017 +0200
Committer: Alan Conway <aconway@redhat.com>
Committed: Mon Oct 23 17:37:33 2017 +0100

----------------------------------------------------------------------
 .travis.yml             | 14 +++++++++++++-
 CMakeLists.txt          |  2 +-
 proton-c/CMakeLists.txt |  6 +++++-
 3 files changed, 19 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/bdfe982f/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index f7a8d77..f8694b0 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -39,10 +39,11 @@ addons:
     - python3-dev
     - php5
     - golang
+    - lcov
 
 install:
 - pip install --user --upgrade pip
-- pip install --user tox
+- pip install --user coverage tox
 - gem install minitest
 
 before_script:
@@ -52,3 +53,14 @@ before_script:
 
 script:
 - cmake --build . --target install && ctest -V ${QPID_PROTON_CTEST_ARGS}
+
+after_success:
+- |
+    if [[ ${CC} = gcc ]]; then
+      mkdir ../build_coverage
+      cd ../build_coverage
+      cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_BUILD_TYPE=Coverage ${QPID_PROTON_CMAKE_ARGS}
+      cmake --build . --target install && ctest -V ${QPID_PROTON_CTEST_ARGS}
+      make coverage
+      bash <(curl -s https://codecov.io/bash)
+    fi

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/bdfe982f/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 75310bd..9f81cbb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -78,7 +78,7 @@ if (CMAKE_BUILD_TYPE MATCHES "Coverage")
   make_directory(coverage_results)
   add_custom_target(coverage
     WORKING_DIRECTORY ./coverage_results
-    CgOMMAND ${CMAKE_SOURCE_DIR}/bin/record-coverage.sh ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
+    COMMAND ${CMAKE_SOURCE_DIR}/bin/record-coverage.sh ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
 endif()
 
 if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/bdfe982f/proton-c/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/proton-c/CMakeLists.txt b/proton-c/CMakeLists.txt
index 4cd4bd5..c420649 100644
--- a/proton-c/CMakeLists.txt
+++ b/proton-c/CMakeLists.txt
@@ -744,13 +744,17 @@ if (BUILD_PYTHON)
   to_native_path ("${py_pythonpath}" py_pythonpath)
   to_native_path ("${py_path}" py_path)
 
+  if (CMAKE_BUILD_TYPE MATCHES "Coverage")
+    set (python_coverage_options -m coverage run)
+  endif(CMAKE_BUILD_TYPE MATCHES "Coverage")
+
   add_test (NAME python-test
             COMMAND ${env_py}
               "PATH=${py_path}" "PYTHONPATH=${py_pythonpath}"
               "CLASSPATH=${CMAKE_BINARY_DIR}/proton-j/proton-j.jar"
               "SASLPASSWD=${SASLPASSWD_EXE}"
               ${VALGRIND_ENV}
-              ${PYTHON_EXECUTABLE} "${py_root}/proton-test")
+              ${PYTHON_EXECUTABLE} -- ${python_coverage_options} "${py_root}/proton-test")
   set_tests_properties(python-test PROPERTIES PASS_REGULAR_EXPRESSION "Totals: .* 0 failed")
 
   # Eventually, we'll get rid of this check when other


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message