blob: 4e8d6f6e9d5cd7e2450283eecb14b46c3dbc393d [file] [log] [blame]
Arkadiy Shapkin43c0ae32016-06-25 01:29:18 +03001version: '{build}'
2
3os: Visual Studio 2015
4
5environment:
6 matrix:
Arkady Shapkinb153bfd2017-10-25 18:37:57 +03007 - compiler: msvc-15-seh
8 generator: "Visual Studio 15 2017"
9 APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
10
11 - compiler: msvc-15-seh
12 generator: "Visual Studio 15 2017 Win64"
13 APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
14
Arkadiy Shapkin5dde6682016-09-05 00:55:42 +030015 - compiler: msvc-14-seh
16 generator: "Visual Studio 14 2015"
Arkadiy Shapkin43c0ae32016-06-25 01:29:18 +030017
Arkadiy Shapkin5dde6682016-09-05 00:55:42 +030018 - compiler: msvc-14-seh
19 generator: "Visual Studio 14 2015 Win64"
20
21 - compiler: msvc-12-seh
22 generator: "Visual Studio 12 2013"
23
24 - compiler: msvc-12-seh
25 generator: "Visual Studio 12 2013 Win64"
26
27 - compiler: msvc-11-seh
28 generator: "Visual Studio 11 2012"
29
30 - compiler: msvc-11-seh
31 generator: "Visual Studio 11 2012 Win64"
32
33 - compiler: msvc-10-seh
34 generator: "Visual Studio 10 2010"
35
36 - compiler: gcc-5.3.0-posix
37 generator: "MinGW Makefiles"
38 cxx_path: 'C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin'
39
40 - compiler: gcc-6.3.0-posix
41 generator: "MinGW Makefiles"
42 cxx_path: 'C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin'
Arkadiy Shapkin43c0ae32016-06-25 01:29:18 +030043
44configuration:
Arkadiy Shapkin43c0ae32016-06-25 01:29:18 +030045 - Debug
Arkadiy Shapkin5dde6682016-09-05 00:55:42 +030046 #- Release
Arkadiy Shapkin43c0ae32016-06-25 01:29:18 +030047
48build:
49 verbosity: minimal
50
Arkadiy Shapkin5dde6682016-09-05 00:55:42 +030051install:
Arkadiy Shapkin43c0ae32016-06-25 01:29:18 +030052- ps: |
Arkadiy Shapkin5dde6682016-09-05 00:55:42 +030053 Write-Output "Compiler: $env:compiler"
54 Write-Output "Generator: $env:generator"
55
56 # git bash conflicts with MinGW makefiles
57 if ($env:generator -eq "MinGW Makefiles") {
58 $env:path = $env:path.replace("C:\Program Files\Git\usr\bin;", "")
59 if ($env:cxx_path -ne "") {
60 $env:path += ";$env:cxx_path"
61 }
Arkadiy Shapkin43c0ae32016-06-25 01:29:18 +030062 }
63
64build_script:
65- ps: |
Arkadiy Shapkin43c0ae32016-06-25 01:29:18 +030066 md _build -Force | Out-Null
67 cd _build
68
Arkadiy Shapkin5dde6682016-09-05 00:55:42 +030069 $conf = if ($env:generator -eq "MinGW Makefiles") {"-DCMAKE_BUILD_TYPE=$env:configuration"} else {"-DCMAKE_CONFIGURATION_TYPES=Debug;Release"}
70 # Disable test for MinGW (gtest tests fail, gmock tests can not build)
71 $gtest_build_tests = if ($env:generator -eq "MinGW Makefiles") {"-Dgtest_build_tests=OFF"} else {"-Dgtest_build_tests=ON"}
72 $gmock_build_tests = if ($env:generator -eq "MinGW Makefiles") {"-Dgmock_build_tests=OFF"} else {"-Dgmock_build_tests=ON"}
73 & cmake -G "$env:generator" $conf -Dgtest_build_samples=ON $gtest_build_tests $gmock_build_tests ..
Arkadiy Shapkin43c0ae32016-06-25 01:29:18 +030074 if ($LastExitCode -ne 0) {
75 throw "Exec: $ErrorMessage"
76 }
Arkadiy Shapkin5dde6682016-09-05 00:55:42 +030077 & cmake --build . --config $env:configuration
Arkadiy Shapkin43c0ae32016-06-25 01:29:18 +030078 if ($LastExitCode -ne 0) {
79 throw "Exec: $ErrorMessage"
80 }
81
82test_script:
83- ps: |
Arkadiy Shapkin5dde6682016-09-05 00:55:42 +030084 if ($env:generator -eq "MinGW Makefiles") {
85 return # No test available for MinGW
Arkadiy Shapkin43c0ae32016-06-25 01:29:18 +030086 }
Arkadiy Shapkin5dde6682016-09-05 00:55:42 +030087 & ctest -C $env:configuration --timeout 300 --output-on-failure
Arkadiy Shapkin43c0ae32016-06-25 01:29:18 +030088 if ($LastExitCode -ne 0) {
89 throw "Exec: $ErrorMessage"
90 }
Arkadiy Shapkin5dde6682016-09-05 00:55:42 +030091
92artifacts:
93 - path: '_build/CMakeFiles/*.log'
94 name: logs
95 - path: '_build/Testing/**/*.xml'
96 name: test_results