Skip to content
This repository has been archived by the owner on Feb 1, 2020. It is now read-only.

Commit

Permalink
Add code coverage support to testing suite with coveralls.io
Browse files Browse the repository at this point in the history
  • Loading branch information
fjricci committed Apr 5, 2016
1 parent b974511 commit 4d169b3
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .coveralls.yml
@@ -0,0 +1,2 @@
service_name: travis-pro
repo_token: Oy7FhRq2S3xhLdYg41UyfLJjkM9SUIf44
2 changes: 2 additions & 0 deletions .travis.yml
Expand Up @@ -49,3 +49,5 @@ env:
before_install: ./Support/Testing/Travis/before-install.py
install: ./Support/Testing/Travis/install.py
script: ./Support/Testing/Travis/script.sh
after_success:
- coveralls --exclude lib --exclude tests --gcov-options '\-lp'
4 changes: 4 additions & 0 deletions CMakeLists.txt
Expand Up @@ -290,6 +290,10 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
target_compile_options(ds2 PRIVATE /MP)
endif ()

if (COVERAGE)
target_compile_options(ds2 PRIVATE -ftest-coverage)
endif()

add_subdirectory(Tools/JSObjects "${CMAKE_CURRENT_BINARY_DIR}/JSObjects")
target_link_libraries(ds2 jsobjects)

Expand Down
2 changes: 1 addition & 1 deletion README.md
@@ -1,4 +1,4 @@
# ds2 [![Travis Build Status](https://travis-ci.org/facebook/ds2.svg?branch=master)](https://travis-ci.org/facebook/ds2) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/sdt15jwwbv2ocdlg/branch/master?svg=true)](https://ci.appveyor.com/project/a20012251/ds2/branch/master)
# ds2 [![Travis Build Status](https://travis-ci.org/facebook/ds2.svg?branch=master)](https://travis-ci.org/facebook/ds2) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/sdt15jwwbv2ocdlg/branch/master?svg=true)](https://ci.appveyor.com/project/a20012251/ds2/branch/master) [![Coverage Status](https://coveralls.io/repos/github/facebook/ds2/badge.svg?branch=master)](https://coveralls.io/github/facebook/ds2?branch=master)

ds2 is a debug server designed to be used with [LLDB](http://lldb.llvm.org/) to
perform remote debugging of Linux, Android, FreeBSD, Windows and Windows Phone
Expand Down
5 changes: 5 additions & 0 deletions Support/Testing/Travis/install.py
Expand Up @@ -56,6 +56,7 @@
# use the lldb python library without us building it).
if os.getenv('LLDB_TESTS') != None:
packages.append('swig')
packages.append('python-pip')
if "CentOS Linux" in platform.linux_distribution():
packages.append('libedit-devel')
packages.append('libxml2-devel')
Expand All @@ -74,3 +75,7 @@
check_call('sudo yum install -y "%s"' % '" "'.join(packages), shell=True)
else:
check_call('sudo apt-get install -y "%s"' % '" "'.join(packages), shell=True)

if os.getenv('LLDB_TESTS') != None:
check_call('sudo pip install --upgrade pip', shell=True)
check_call('sudo pip install --user cpp-coveralls', shell=True)
4 changes: 4 additions & 0 deletions Support/Testing/Travis/script.sh
Expand Up @@ -107,6 +107,10 @@ else
cmake_options+=(-DCMAKE_BUILD_TYPE="Debug")
fi

if [[ -n "${LLDB_TESTS-}" ]]; then
cmake_options+=(-DCOVERAGE="1")
fi

cmake "${cmake_options[@]}" "$top"
make -j$(num_cpus)

Expand Down

0 comments on commit 4d169b3

Please sign in to comment.