@@ -91,6 +91,22 @@ function Find-Git {
91
91
92
92
Push-Location $libgit2Directory
93
93
94
+ function Ensure-Property ($expected , $propertyValue , $propertyName , $path ) {
95
+ if ($propertyValue -eq $expected ) {
96
+ return
97
+ }
98
+
99
+ throw " Error: Invalid '$propertyName ' property in generated '$path ' (Expected: $expected - Actual: $propertyValue )"
100
+ }
101
+
102
+ function Assert-Consistent-Naming ($expected , $path ) {
103
+ $dll = get-item $path
104
+
105
+ Ensure- Property $expected $dll.Name " Name" $dll.Fullname
106
+ Ensure- Property $expected $dll.VersionInfo.InternalName " VersionInfo.InternalName" $dll.Fullname
107
+ Ensure- Property $expected $dll.VersionInfo.OriginalFilename " VersionInfo.OriginalFilename" $dll.Fullname
108
+ }
109
+
94
110
& {
95
111
trap {
96
112
Pop-Location
@@ -112,6 +128,7 @@ Push-Location $libgit2Directory
112
128
break
113
129
}
114
130
$shortsha = $sha.Substring (0 , 7 )
131
+ $expected = " git2-$shortsha .dll"
115
132
116
133
Write-Output " Checking out $sha ..."
117
134
Run- Command - Quiet - Fatal { & $git checkout $sha }
@@ -124,6 +141,7 @@ Push-Location $libgit2Directory
124
141
Run- Command - Quiet - Fatal { & $cmake -- build . -- config $configuration }
125
142
if ($test.IsPresent ) { Run- Command - Quiet - Fatal { & $ctest - V . } }
126
143
cd $configuration
144
+ Assert-Consistent - Naming $expected " *.dll"
127
145
Run- Command - Quiet { & rm * .exp }
128
146
Run- Command - Quiet { & rm $x86Directory \* }
129
147
Run- Command - Quiet - Fatal { & copy - fo * $x86Directory }
@@ -136,6 +154,7 @@ Push-Location $libgit2Directory
136
154
Run- Command - Quiet - Fatal { & $cmake -- build . -- config $configuration }
137
155
if ($test.IsPresent ) { Run- Command - Quiet - Fatal { & $ctest - V . } }
138
156
cd $configuration
157
+ Assert-Consistent - Naming $expected " *.dll"
139
158
Run- Command - Quiet { & rm * .exp }
140
159
Run- Command - Quiet { & rm $x64Directory \* }
141
160
Run- Command - Quiet - Fatal { & copy - fo * $x64Directory }
0 commit comments