1 version: '{build}' 2 3 os: Visual Studio 2015 4 5 environment: 6 matrix: 7 - 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 15 - compiler: msvc-14-seh 16 generator: "Visual Studio 14 2015" 17 18 - 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' 43 44 configuration: 45 - Debug 46 #- Release 47 48 build: 49 verbosity: minimal 50 51 install: 52 - ps: | 53 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 } 62 } 63 64 build_script: 65 - ps: | 66 md _build -Force | Out-Null 67 cd _build 68 69 $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 .. 74 if ($LastExitCode -ne 0) { 75 throw "Exec: $ErrorMessage" 76 } 77 & cmake --build . --config $env:configuration 78 if ($LastExitCode -ne 0) { 79 throw "Exec: $ErrorMessage" 80 } 81 82 test_script: 83 - ps: | 84 if ($env:generator -eq "MinGW Makefiles") { 85 return # No test available for MinGW 86 } 87 & ctest -C $env:configuration --timeout 300 --output-on-failure 88 if ($LastExitCode -ne 0) { 89 throw "Exec: $ErrorMessage" 90 } 91 92 artifacts: 93 - path: '_build/CMakeFiles/*.log' 94 name: logs 95 - path: '_build/Testing/**/*.xml' 96 name: test_results 97