Skip to content

Commit d6a4d8d

Browse files
authored
Merge pull request #16 from pavelkryukov/master
Support AppVeyor
2 parents 9c09479 + 168ef57 commit d6a4d8d

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

.appveyor.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: "{branch}-ci-{build}"
2+
image: Visual Studio 2017
3+
4+
build: msvc
5+
platform: x86
6+
configuration: Debug
7+
8+
install:
9+
- choco install opencppcoverage codecov
10+
- set PATH=C:\Program Files\OpenCppCoverage;%PATH%
11+
12+
build_script:
13+
- mkdir build && cd build
14+
- cmake ..
15+
- MSBuild Example.sln /p:Configuration=%configuration% /p:Platform="Win32" /nologo /m /verbosity:minimal
16+
- OpenCppCoverage --export_type cobertura:coverage.xml --modules "*.exe" --cover_children -- ctest -C %configuration% --output-on-failure
17+
- codecov -f coverage.xml --root %APPVEYOR_BUILD_FOLDER%

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
The goal of this project is to build project with following tools:
1111
* C++ version: `C++11`
1212
* Build system: [`CMake`](https://cmake.org/)
13-
* C++ compiler: `g++`
13+
* C++ compiler: `g++` or Visual Studio
1414
* Libraries: `STL` only
15-
* Code coverage report: [`lcov`](http://ltp.sourceforge.net/coverage/lcov.php) (note: it should show the code coverage is below 100%)
15+
* 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%)
1616
* [`CodeCov`](https://codecov.io/) (code coverage is measured by CodeCov).
1717
* Source: multiple files
1818

src/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
add_library(example complex.cpp)
22
target_include_directories(example PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
33
# Setting this to the library only avoids errors in 3rd party dependencies which are compile with e.g. -Werror
4-
target_compile_options(example PUBLIC -Wall -pedantic)
4+
if(NOT MSVC)
5+
target_compile_options(example PUBLIC -Wall -pedantic)
6+
endif(NOT MSVC)
57
# Include code-coverage settings:
68
target_link_libraries(example PUBLIC coverage_config)
79

0 commit comments

Comments
 (0)