7 - compiler: msvc-15-seh
8 generator: "Visual Studio 15 2017"
10 APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
12 - compiler: msvc-15-seh
13 generator: "Visual Studio 15 2017 Win64"
15 APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
18 - compiler: msvc-15-seh
20 APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
23 - compiler: msvc-14-seh
25 generator: "Visual Studio 14 2015"
28 - compiler: msvc-14-seh
30 generator: "Visual Studio 14 2015 Win64"
32 - compiler: gcc-6.3.0-posix
34 generator: "MinGW Makefiles"
35 cxx_path: 'C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin'
46 Write-Output "Compiler: $env:compiler"
47 Write-Output "Generator: $env:generator"
48 Write-Output "Env:Configuation: $env:configuration"
49 Write-Output "Env: $env"
50 if (-not (Test-Path env:APPVEYOR_PULL_REQUEST_NUMBER)) {
51 Write-Output "This is *NOT* a pull request build"
53 Write-Output "This is a pull request build"
54 if (-not (Test-Path env:enabled_on_pr) -or $env:enabled_on_pr -ne "yes") {
55 Write-Output "PR builds are *NOT* explicitly enabled"
60 if ($env:build_system -eq "bazel") {
61 appveyor DownloadFile https://github.com/bazelbuild/bazel/releases/download/0.28.1/bazel-0.28.1-windows-x86_64.exe -FileName bazel.exe
64 if ($env:build_system -eq "cmake") {
65 # git bash conflicts with MinGW makefiles
66 if ($env:generator -eq "MinGW Makefiles") {
67 $env:path = $env:path.replace("C:\Program Files\Git\usr\bin;", "")
68 if ($env:cxx_path -ne "") {
69 $env:path += ";$env:cxx_path"
76 $env:root=$env:APPVEYOR_BUILD_FOLDER
77 Write-Output "env:root: $env:root"
81 # Only enable some builds for pull requests, the AppVeyor queue is too long.
82 if ((Test-Path env:APPVEYOR_PULL_REQUEST_NUMBER) -And (-not (Test-Path env:enabled_on_pr) -or $env:enabled_on_pr -ne "yes")) {
85 # special case - build with Bazel
86 if ($env:build_system -eq "bazel") {
87 & $env:root\bazel.exe build -c opt //:gtest_samples
88 if ($LastExitCode -eq 0) { # bazel writes to StdErr and PowerShell interprets it as an error
89 $host.SetShouldExit(0)
90 } else { # a real error
91 throw "Exec: $ErrorMessage"
96 # by default build with CMake
97 md _build -Force | Out-Null
100 $conf = if ($env:generator -eq "MinGW Makefiles") {"-DCMAKE_BUILD_TYPE=$env:configuration"} else {"-DCMAKE_CONFIGURATION_TYPES=Debug;Release"}
101 # Disable test for MinGW (gtest tests fail, gmock tests can not build)
102 $gtest_build_tests = if ($env:generator -eq "MinGW Makefiles") {"-Dgtest_build_tests=OFF"} else {"-Dgtest_build_tests=ON"}
103 $gmock_build_tests = if ($env:generator -eq "MinGW Makefiles") {"-Dgmock_build_tests=OFF"} else {"-Dgmock_build_tests=ON"}
104 & cmake -G "$env:generator" $conf -Dgtest_build_samples=ON $gtest_build_tests $gmock_build_tests ..
105 if ($LastExitCode -ne 0) {
106 throw "Exec: $ErrorMessage"
108 $cmake_parallel = if ($env:generator -eq "MinGW Makefiles") {"-j2"} else {"/m"}
109 & cmake --build . --config $env:configuration -- $cmake_parallel
110 if ($LastExitCode -ne 0) {
111 throw "Exec: $ErrorMessage"
121 # Only enable some builds for pull requests, the AppVeyor queue is too long.
122 if ((Test-Path env:APPVEYOR_PULL_REQUEST_NUMBER) -And (-not (Test-Path env:enabled_on_pr) -or $env:enabled_on_pr -ne "yes")) {
125 if ($env:build_system -eq "bazel") {
126 # special case - testing with Bazel
127 & $env:root\bazel.exe test //:gtest_samples
128 if ($LastExitCode -eq 0) { # bazel writes to StdErr and PowerShell interprets it as an error
129 $host.SetShouldExit(0)
130 } else { # a real error
131 throw "Exec: $ErrorMessage"
134 if ($env:build_system -eq "cmake") {
135 # built with CMake - test with CTest
136 if ($env:generator -eq "MinGW Makefiles") {
137 return # No test available for MinGW
140 & ctest -C $env:configuration --timeout 600 --output-on-failure
141 if ($LastExitCode -ne 0) {
142 throw "Exec: $ErrorMessage"
147 - path: '_build/CMakeFiles/*.log'
149 - path: '_build/Testing/**/*.xml'
151 - path: 'bazel-testlogs/**/test.log'
153 - path: 'bazel-testlogs/**/test.xml'