forked from KindDragon/vld
-
Notifications
You must be signed in to change notification settings - Fork 5
/
appveyor.yml
158 lines (139 loc) · 4.67 KB
/
appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
version: '{build}'
branches:
# blacklist
except:
- gh-pages
os: Visual Studio 2015
environment:
GTEST_REPEAT: 1
matrix:
- VldStackWalkMethod: safe
Toolset: v90
Solution: vld_vs14_wo_mfc.sln
GTEST_FILTER: -*.Mfc*
- VldStackWalkMethod: safe
Toolset: v100
Solution: vld_vs14_wo_mfc.sln
GTEST_FILTER: -*.Mfc*
- VldStackWalkMethod: safe
Toolset: v110
Solution: vld_vs14_wo_mfc.sln
GTEST_FILTER: -*.Mfc*
- VldStackWalkMethod: safe
Toolset: v120_xp
Solution: vld_vs14.sln
- VldStackWalkMethod: safe
Toolset: v140_xp
Solution: vld_vs14.sln
- VldStackWalkMethod: fast
Toolset: v90
Solution: vld_vs14_wo_mfc.sln
GTEST_FILTER: -*.Mfc*
- VldStackWalkMethod: fast
Toolset: v100
Solution: vld_vs14_wo_mfc.sln
GTEST_FILTER: -*.Mfc*
- VldStackWalkMethod: fast
Toolset: v110
Solution: vld_vs14_wo_mfc.sln
GTEST_FILTER: -*.Mfc*
- VldStackWalkMethod: fast
Toolset: v120_xp
Solution: vld_vs14.sln
- VldStackWalkMethod: fast
Toolset: v140_xp
Solution: vld_vs14.sln
platform:
- Win32
- x64
configuration:
- Debug_VldRelease
- Debug_VldRelease_StaticCrt
- Release
- Release_StaticCrt
matrix:
fast_finish: false
nuget:
project_feed: true
disable_publish_on_pr: true
notifications:
- provider: Webhook
url: https://webhooks.gitter.im/e/f26eac97358590c8feca
on_build_success: true
on_build_failure: true
on_build_status_changed: true
build_script:
- ps: |
Write-Output "Configuration: $env:CONFIGURATION"
Write-Output "Platform: $env:PLATFORM"
if (($env:Toolset -eq "v100") -and ($env:PLATFORM -eq "x64"))
{
return
}
& .\change_toolset.ps1 $env:Toolset
msbuild /v:m /p:"Configuration=$env:CONFIGURATION" /p:Platform="$env:PLATFORM" "$env:Solution" /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
test_script:
- ps: |
if (($env:Toolset -eq "v100") -and ($env:PLATFORM -eq "x64"))
{
return
}
cd src\
function Add-GTest-Result($testResult)
{
$testsuites = ([xml](get-content $testResult)).testsuites
$testsCount = 0
$anyFailures = $FALSE
foreach ($testsuite in $testsuites.testsuite) {
foreach ($testcase in $testsuite.testcase) {
$testsCount++
if ($testcase.failure) {
$time = ([double]$testcase.time * 1000)
Add-AppveyorTest $testcase.name -Outcome Failed -FileName $testsuite.name -Duration $time -ErrorMessage $testcase.failure.message
Add-AppveyorMessage "$($testcase.name) failed" -Category Error
$anyFailures = $TRUE
}
elseif ($testcase.skipped) {
Add-AppveyorTest $testcase.name -Outcome Ignored -Filename $testsuite.name
}
else {
$time = ([double]$testcase.time * 1000)
Add-AppveyorTest $testcase.name -Outcome Passed -FileName $testsuite.name -Duration $time
}
}
}
return $testsCount, $anyFailures
}
function Run-Tests($platform, $configuration, $correctTestCount)
{
$testsCount = 0
$anyFailures = $FALSE
$tests_path = ".\bin\$platform\$configuration\"
# Run tests and upload results to AppVeyor one by one
Get-ChildItem "$tests_path\*.exe" | foreach {
$testfile = "$($_.FullName).xml"
& $_.FullName "--gtest_output=`"xml:$testfile`""
if (Test-Path $testfile)
{
$count, $testsResult = Add-GTest-Result $testfile
Write-Output "Found $testfile with $count tests"
$testsCount = $testsCount + $count
$anyFailures = $anyFailures -or $testsResult
}
}
if ($anyFailures -eq $TRUE){
Write-Output "Failing build as there are broken tests"
$host.SetShouldExit(1)
}
if ($testsCount -lt $correctTestCount){
Write-Output "Failing build as there the number of tests decreased from $correctTestCount"
$host.SetShouldExit(2)
}
}
$pos = $env:Toolset.IndexOf("_")
if ($pos -eq -1) { $pos = $env:Toolset.length }
$suffix = $env:Toolset.Substring(0, $pos )
$folders = @{"Debug_VldRelease" = "Debug(Release)-$suffix"; "Debug_VldRelease_StaticCrt" = "Debug(Release)_StaticCrt-$suffix";
"Release" = "Release-$suffix"; "Release_StaticCrt" = "Release_StaticCrt-$suffix"}
$correctTestCount = if ($env:GTEST_FILTER -like '*Mfc*') { 49 } else { 53 }
Run-Tests "$env:PLATFORM" "$($folders[$env:CONFIGURATION])" $correctTestCount