Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pistache
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
pistache
Commits
1df04a35
Unverified
Commit
1df04a35
authored
Feb 10, 2019
by
Dennis Jenkins
Committed by
GitHub
Feb 10, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #445 from arthurafarias/arthurafarias-add-coverage
Add coverage test and integration with codecov.io
parents
c03dc7e0
7b1e8e23
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
33 deletions
+36
-33
.travis.yml
.travis.yml
+24
-33
CMakeLists.txt
CMakeLists.txt
+12
-0
No files found.
.travis.yml
View file @
1df04a35
...
...
@@ -16,14 +16,7 @@ matrix:
addons
:
apt
:
sources
:
[
'
ubuntu-toolchain-r-test'
,
'
llvm-toolchain-trusty-4.0'
]
packages
:
[
'
cmake'
,
'
clang-4.0'
,
'
libstdc++-6-dev'
,
'
libssl-dev'
,
'
libcurl4-openssl-dev'
,
'
gdb'
]
packages
:
[
'
cmake'
,
'
clang-4.0'
,
'
libstdc++-6-dev'
,
'
libssl-dev'
,
'
libcurl4-openssl-dev'
,
'
gdb'
,
'
lcov'
]
-
os
:
linux
compiler
:
clang
...
...
@@ -31,14 +24,7 @@ matrix:
addons
:
apt
:
sources
:
[
'
ubuntu-toolchain-r-test'
,
'
llvm-toolchain-trusty-5.0'
]
packages
:
[
'
cmake'
,
'
clang-5.0'
,
'
libstdc++-6-dev'
,
'
libssl-dev'
,
'
libcurl4-openssl-dev'
,
'
gdb'
]
packages
:
[
'
cmake'
,
'
clang-5.0'
,
'
libstdc++-6-dev'
,
'
libssl-dev'
,
'
libcurl4-openssl-dev'
,
'
gdb'
,
'
lcov'
]
-
os
:
linux
compiler
:
clang
...
...
@@ -46,14 +32,7 @@ matrix:
addons
:
apt
:
sources
:
[
'
ubuntu-toolchain-r-test'
,
'
llvm-toolchain-trusty-6.0'
]
packages
:
[
'
cmake'
,
'
clang-6.0'
,
'
libstdc++-6-dev'
,
'
libssl-dev'
,
'
libcurl4-openssl-dev'
,
'
gdb'
]
packages
:
[
'
cmake'
,
'
clang-6.0'
,
'
libstdc++-6-dev'
,
'
libssl-dev'
,
'
libcurl4-openssl-dev'
,
'
gdb'
,
'
lcov'
]
# Linux GCC builds
-
os
:
linux
...
...
@@ -62,7 +41,7 @@ matrix:
addons
:
apt
:
sources
:
[
'
ubuntu-toolchain-r-test'
]
packages
:
[
'
g++-4.9'
,
'
libssl-dev'
,
'
libcurl4-openssl-dev'
,
'
gdb'
]
packages
:
[
'
g++-4.9'
,
'
libssl-dev'
,
'
libcurl4-openssl-dev'
,
'
gdb'
,
'
lcov'
]
-
os
:
linux
compiler
:
gcc
...
...
@@ -70,7 +49,7 @@ matrix:
addons
:
apt
:
sources
:
[
'
ubuntu-toolchain-r-test'
]
packages
:
[
'
g++-5'
,
'
libssl-dev'
,
'
libcurl4-openssl-dev'
,
'
gdb'
]
packages
:
[
'
g++-5'
,
'
libssl-dev'
,
'
libcurl4-openssl-dev'
,
'
gdb'
,
'
lcov'
]
-
os
:
linux
compiler
:
gcc
...
...
@@ -78,7 +57,7 @@ matrix:
addons
:
apt
:
sources
:
[
'
ubuntu-toolchain-r-test'
]
packages
:
[
'
g++-6'
,
'
libssl-dev'
,
'
libcurl4-openssl-dev'
,
'
gdb'
]
packages
:
[
'
g++-6'
,
'
libssl-dev'
,
'
libcurl4-openssl-dev'
,
'
gdb'
,
'
lcov'
]
-
os
:
linux
compiler
:
gcc
...
...
@@ -86,7 +65,7 @@ matrix:
addons
:
apt
:
sources
:
[
'
ubuntu-toolchain-r-test'
]
packages
:
[
'
g++-7'
,
'
libssl-dev'
,
'
libcurl4-openssl-dev'
,
'
gdb'
]
packages
:
[
'
g++-7'
,
'
libssl-dev'
,
'
libcurl4-openssl-dev'
,
'
gdb'
,
'
lcov'
]
-
os
:
linux
compiler
:
gcc
...
...
@@ -94,7 +73,7 @@ matrix:
addons
:
apt
:
sources
:
[
'
ubuntu-toolchain-r-test'
]
packages
:
[
'
g++-8'
,
'
libssl-dev'
,
'
libcurl4-openssl-dev'
,
'
gdb'
]
packages
:
[
'
g++-8'
,
'
libssl-dev'
,
'
libcurl4-openssl-dev'
,
'
gdb'
,
'
lcov'
]
install
:
-
DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
...
...
@@ -116,14 +95,18 @@ before_script:
-
initctl list ||
true
# Debug build
-
cmake -H. -BBuild-Debug
-
cmake -H.
-BBuild-Debug
-DCMAKE_BUILD_TYPE=Debug
-DPISTACHE_BUILD_EXAMPLES=true
-DPISTACHE_BUILD_TESTS=true
-DPISTACHE_SSL=true
# Release build
-
cmake -H. -BBuild-Release -DCMAKE_BUILD_TYPE=Release -DPISTACHE_SSL=true
-
cmake -H.
-BBuild-Release
-DCMAKE_BUILD_TYPE=Release
-DPISTACHE_SSL=true
script
:
-
# Debug build
...
...
@@ -135,9 +118,17 @@ script:
-
make -j
2
after_failure
:
# find and print core file
-
ls -lta /var/crash
-
COREFILE=$(find ./ -maxdepth 1 -name "core*" -print | head -n 1)
-
if [[ -f "$COREFILE" ]]; then
gdb -c "$COREFILE" -ex "thread apply all bt" -ex "set pagination 0" -batch;
fi
\ No newline at end of file
fi
after_success
:
-
cd ../Build-Debug
-
export PISTACHE_SRC_ROOT=$(realpath $(pwd)/..)
-
lcov --capture --directory . --output-file coverage.info
-
lcov --remove coverage.info '/usr/*' "$PISTACHE_SRC_ROOT/test/*" "$PISTACHE_SRC_ROOT/googletest-release-1.7.0" --output-file coverage.info
-
lcov --list coverage.info
-
bash <(curl -s https://codecov.io/bash) -f coverage.info -t 1db5f955-be83-4bb5-8a8a-eeb4ad07ce11 || echo "Codecov did not collect coverage reports"
\ No newline at end of file
CMakeLists.txt
View file @
1df04a35
...
...
@@ -3,15 +3,27 @@ project (pistache)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wall -pedantic -Wextra -Wno-missing-field-initializers"
)
if
(
NOT CMAKE_BUILD_TYPE
)
set
(
CMAKE_BUILD_TYPE Release
)
endif
()
if
(
CMAKE_BUILD_TYPE MATCHES
"Debug"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-g -O0 -fprofile-arcs -ftest-coverage"
)
endif
()
option
(
PISTACHE_BUILD_TESTS
"build tests alongside the project"
OFF
)
option
(
PISTACHE_BUILD_EXAMPLES
"build examples alongside the project"
OFF
)
option
(
PISTACHE_INSTALL
"add pistache as install target (recommended)"
ON
)
option
(
PISTACHE_SSL
"add support for SSL server"
OFF
)
find_program
(
CTEST_MEMORYCHECK_COMMAND NAMES valgrind
)
find_program
(
CTEST_COVERAGE_COMMAND NAMES gcov
)
INCLUDE
(
Dart
)
add_custom_target
(
test_memcheck COMMAND
${
CMAKE_CTEST_COMMAND
}
--force-new-ctest-process --test-action memcheck
)
add_custom_target
(
coverage COMMAND
${
CMAKE_CTEST_COMMAND
}
--force-new-ctest-process --test-action coverage
)
# CMAKE version less than 3.8 does not understand the CMAKE_CXX_FLAGS
# set to 17, so a manual check if performed on older version
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment