Skip to content

Commit 168ef57

Browse files
committed
Support AppVeyor
1 parent 2036eab commit 168ef57

File tree

4 files changed

+23
-4
lines changed

4 files changed

+23
-4
lines changed

.appveyor.yml

+17
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%

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if(CODE_COVERAGE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
2424
else()
2525
target_link_libraries(coverage_config INTERFACE --coverage)
2626
endif()
27-
endif(CODE_COVERAGE)
27+
endif(CODE_COVERAGE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
2828

2929

3030
add_subdirectory(src)

README.md

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

src/CMakeLists.txt

+3-1
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)