Skip to content
Merged
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
17 changes: 17 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: "{branch}-ci-{build}"
image: Visual Studio 2017

build: msvc
platform: x86
configuration: Debug

install:
- choco install opencppcoverage codecov
- set PATH=C:\Program Files\OpenCppCoverage;%PATH%

build_script:
- mkdir build && cd build
- cmake ..
- MSBuild Example.sln /p:Configuration=%configuration% /p:Platform="Win32" /nologo /m /verbosity:minimal
- OpenCppCoverage --export_type cobertura:coverage.xml --modules "*.exe" --cover_children -- ctest -C %configuration% --output-on-failure
- codecov -f coverage.xml --root %APPVEYOR_BUILD_FOLDER%
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if(CODE_COVERAGE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
else()
target_link_libraries(coverage_config INTERFACE --coverage)
endif()
endif(CODE_COVERAGE)
endif(CODE_COVERAGE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")


add_subdirectory(src)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
The goal of this project is to build project with following tools:
* C++ version: `C++11`
* Build system: [`CMake`](https://cmake.org/)
* C++ compiler: `g++`
* C++ compiler: `g++` or Visual Studio
* Libraries: `STL` only
* Code coverage report: [`lcov`](http://ltp.sourceforge.net/coverage/lcov.php) (note: it should show the code coverage is below 100%)
* Code coverage report: [`lcov`](http://ltp.sourceforge.net/coverage/lcov.php) and [`OpenCppCoverage`](https://github.com/OpenCppCoverage/OpenCppCoverage)(note: it should show the code coverage is below 100%)
* [`CodeCov`](https://codecov.io/) (code coverage is measured by CodeCov).
* Source: multiple files

Expand Down
4 changes: 3 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
add_library(example complex.cpp)
target_include_directories(example PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
# Setting this to the library only avoids errors in 3rd party dependencies which are compile with e.g. -Werror
target_compile_options(example PUBLIC -Wall -pedantic)
if(NOT MSVC)
target_compile_options(example PUBLIC -Wall -pedantic)
endif(NOT MSVC)
# Include code-coverage settings:
target_link_libraries(example PUBLIC coverage_config)