Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,15 @@ matrix:
before_script:
- export CC="gcc-4.9"
- export CXX="g++-4.9"
- export ARROW_TRAVIS_COVERAGE=1
- export ARROW_TRAVIS_USE_TOOLCHAIN=1
- export ARROW_TRAVIS_VALGRIND=1
- export ARROW_TRAVIS_PLASMA=1
- $TRAVIS_BUILD_DIR/ci/travis_lint.sh
- $TRAVIS_BUILD_DIR/ci/travis_before_script_cpp.sh
script:
- $TRAVIS_BUILD_DIR/ci/travis_script_cpp.sh
- $TRAVIS_BUILD_DIR/ci/upload_cpp_coverage.sh
- $TRAVIS_BUILD_DIR/ci/travis_build_parquet_cpp.sh
- $TRAVIS_BUILD_DIR/ci/travis_script_python.sh 2.7
- $TRAVIS_BUILD_DIR/ci/travis_script_python.sh 3.6
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
<img src="https://travis-ci.org/apache/arrow.svg?branch=master" alt="travis build status" />
</a>
</td>

<td>Code Coverage</td>
<td>
<a href='https://coveralls.io/github/apache/arrow?branch=master'><img src='https://coveralls.io/repos/github/apache/arrow/badge.svg?branch=master' alt='Coverage Status' /></a>
</td>
</tr>
</table>

Expand Down
4 changes: 4 additions & 0 deletions ci/travis_before_script_cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ if [ $ARROW_TRAVIS_VALGRIND == "1" ]; then
CMAKE_COMMON_FLAGS="$CMAKE_COMMON_FLAGS -DARROW_TEST_MEMCHECK=ON"
fi

if [ $ARROW_TRAVIS_COVERAGE == "1" ]; then
CMAKE_COMMON_FLAGS="$CMAKE_COMMON_FLAGS -DARROW_GENERATE_COVERAGE=1"
fi

if [ $TRAVIS_OS_NAME == "linux" ]; then
cmake $CMAKE_COMMON_FLAGS \
$CMAKE_LINUX_FLAGS \
Expand Down
68 changes: 68 additions & 0 deletions ci/upload_cpp_coverage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/usr/bin/env bash
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

set -e
set -x

ROOT_DIR=$(cd "$(dirname "$BASH_SOURCE")"; pwd)

source $TRAVIS_BUILD_DIR/ci/travis_env_common.sh

# Current cpp-coveralls version 0.4 throws an error (PARQUET-1075) on Travis
# CI. Pin to last working version
pip install cpp_coveralls==0.3.12

mkdir coverage_artifacts
python $TRAVIS_BUILD_DIR/cpp/build-support/collect_coverage.py \
$ARROW_CPP_BUILD_DIR \
coverage_artifacts

cd coverage_artifacts

ls -l

coveralls --gcov-options '\-l' \
-r $ARROW_CPP_DIR \
--include $ARROW_CPP_DIR \
--exclude $CPP_TOOLCHAIN \
--exclude $ARROW_CPP_BUILD_DIR/boost_ep \
--exclude $ARROW_CPP_BUILD_DIR/boost_ep-prefix \
--exclude $ARROW_CPP_BUILD_DIR/brotli_ep \
--exclude $ARROW_CPP_BUILD_DIR/brotli_ep-prefix \
--exclude $ARROW_CPP_BUILD_DIR/flatbuffers_ep \
--exclude $ARROW_CPP_BUILD_DIR/flatbuffers_ep-prefix \
--exclude $ARROW_CPP_BUILD_DIR/gbenchmark_ep \
--exclude $ARROW_CPP_BUILD_DIR/gbenchmark_ep-prefix \
--exclude $ARROW_CPP_BUILD_DIR/gflags_ep \
--exclude $ARROW_CPP_BUILD_DIR/gflags_ep-prefix \
--exclude $ARROW_CPP_BUILD_DIR/googletest_ep \
--exclude $ARROW_CPP_BUILD_DIR/googletest_ep-prefix \
--exclude $ARROW_CPP_BUILD_DIR/grpc_ep \
--exclude $ARROW_CPP_BUILD_DIR/grpc_ep-prefix \
--exclude $ARROW_CPP_BUILD_DIR/jemalloc_ep \
--exclude $ARROW_CPP_BUILD_DIR/jemalloc_ep-prefix \
--exclude $ARROW_CPP_BUILD_DIR/lz4_ep \
--exclude $ARROW_CPP_BUILD_DIR/lz4_ep-prefix \
--exclude $ARROW_CPP_BUILD_DIR/rapidjson_ep \
--exclude $ARROW_CPP_BUILD_DIR/rapidjson_ep-prefix \
--exclude $ARROW_CPP_BUILD_DIR/snappy_ep \
--exclude $ARROW_CPP_BUILD_DIR/snappy_ep-prefix \
--exclude $ARROW_CPP_BUILD_DIR/zlib_ep \
--exclude $ARROW_CPP_BUILD_DIR/zlib_ep-prefix \
--exclude $ARROW_CPP_BUILD_DIR/zstd_ep \
--exclude $ARROW_CPP_BUILD_DIR/zstd_ep-prefix \
--exclude /usr
4 changes: 2 additions & 2 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,6 @@ include(ThirdpartyToolchain)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_COMMON_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARROW_CXXFLAGS}")

message(STATUS "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")

if ("${COMPILER_FAMILY}" STREQUAL "clang")
# Using Clang with ccache causes a bunch of spurious warnings that are
# purportedly fixed in the next version of ccache. See the following for details:
Expand Down Expand Up @@ -306,6 +304,8 @@ if ("${ARROW_GENERATE_COVERAGE}")
endif()
endif()

message(STATUS "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")

# set compile output directory
string (TOLOWER ${CMAKE_BUILD_TYPE} BUILD_SUBDIR_NAME)

Expand Down
48 changes: 48 additions & 0 deletions cpp/build-support/collect_coverage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/usr/bin/env python
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

import os
import os.path as osp
import shutil
import sys


def is_coverage_file(path):
return path.endswith('gcno') or path.endswith('gcda')


def copy_files(path, outpath='.'):
for root, dirs, files in os.walk(path):
if len(files) > 0:
print(root)
print(dirs)
print(files)
for fname in files:
if not is_coverage_file(fname):
continue
relpath = osp.join(root, fname)
dstpath = '_'.join((root.replace(path, '').replace('/', '_'),
fname))

shutil.copy(relpath, osp.join(outpath, dstpath))


if __name__ == '__main__':
path = sys.argv[1]
outpath = sys.argv[2]
copy_files(path, outpath)