diff options
| author | ras0219 <533828+ras0219@users.noreply.github.com> | 2020-07-08 15:08:17 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-08 15:08:17 -0700 |
| commit | fd4a08806fd88299814aac886e57708ade1d7398 (patch) | |
| tree | 8c1a013d8055bc4b80c67dbd63f0a7ba59be71ed /scripts/azure-pipelines | |
| parent | 82797496cabc0ca34a36cbb70156924c491e6204 (diff) | |
| download | vcpkg-fd4a08806fd88299814aac886e57708ade1d7398.tar.gz vcpkg-fd4a08806fd88299814aac886e57708ade1d7398.zip | |
[vcpkg] Fix MSBuild regressions #12062 and #12086. (#12257)
This PR also renames the VcpkgUserTriplet MSBuild variable to VcpkgTriplet to minimize user confusion compared to previous practice and documentation.
Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
Diffstat (limited to 'scripts/azure-pipelines')
| -rw-r--r-- | scripts/azure-pipelines/end-to-end-tests.ps1 | 51 |
1 files changed, 48 insertions, 3 deletions
diff --git a/scripts/azure-pipelines/end-to-end-tests.ps1 b/scripts/azure-pipelines/end-to-end-tests.ps1 index b0642df82..eccefd544 100644 --- a/scripts/azure-pipelines/end-to-end-tests.ps1 +++ b/scripts/azure-pipelines/end-to-end-tests.ps1 @@ -44,9 +44,11 @@ $commonArgs = @( "--x-packages-root=$packagesRoot"
)
-Remove-Item -Recurse -Force $TestingRoot -ErrorAction SilentlyContinue
-mkdir $TestingRoot
-mkdir $NuGetRoot
+function Refresh-TestRoot {
+ Remove-Item -Recurse -Force $TestingRoot -ErrorAction SilentlyContinue
+ mkdir $TestingRoot
+ mkdir $NuGetRoot
+}
function Require-FileExists {
[CmdletBinding()]
@@ -66,12 +68,49 @@ function Require-FileNotExists { throw "'$CurrentTest' should not have created file '$File'"
}
}
+function Throw-IfFailed {
+ if ($LASTEXITCODE -ne 0) {
+ throw "'$CurrentTest' had a step with a nonzero exit code"
+ }
+}
+
+if (-not $IsLinux -and -not $IsMacOS)
+{
+ Refresh-TestRoot
+ # Test msbuild props and targets
+ $CurrentTest = "zlib:x86-windows-static msbuild scripts\testing\integrate-install\..."
+ Write-Host $CurrentTest
+ ./vcpkg $commonArgs install zlib:x86-windows-static --x-binarysource=clear
+ Throw-IfFailed
+ foreach ($project in @("VcpkgTriplet", "VcpkgTriplet2", "VcpkgUseStatic", "VcpkgUseStatic2")) {
+ $CurrentTest = "msbuild scripts\testing\integrate-install\$project.vcxproj"
+ ./vcpkg $commonArgs env "msbuild scripts\testing\integrate-install\$project.vcxproj /p:VcpkgRoot=$TestingRoot /p:IntDir=$TestingRoot\int\ /p:OutDir=$TestingRoot\out\ "
+ Throw-IfFailed
+ Remove-Item -Recurse -Force $TestingRoot\int
+ Remove-Item -Recurse -Force $TestingRoot\out
+ }
+ $CurrentTest = "zlib:x86-windows msbuild scripts\testing\integrate-install\..."
+ Write-Host $CurrentTest
+ ./vcpkg $commonArgs install zlib:x86-windows --x-binarysource=clear
+ Throw-IfFailed
+ foreach ($project in @("Project1", "NoProps")) {
+ $CurrentTest = "msbuild scripts\testing\integrate-install\$project.vcxproj"
+ Write-Host $CurrentTest
+ ./vcpkg $commonArgs env "msbuild scripts\testing\integrate-install\$project.vcxproj /p:VcpkgRoot=$TestingRoot /p:IntDir=$TestingRoot\int\ /p:OutDir=$TestingRoot\out\ "
+ Throw-IfFailed
+ Remove-Item -Recurse -Force $TestingRoot\int
+ Remove-Item -Recurse -Force $TestingRoot\out
+ }
+}
+
+Refresh-TestRoot
# Test simple installation
$args = $commonArgs + @("install","rapidjson","--binarycaching","--x-binarysource=clear;files,$ArchiveRoot,write;nuget,$NuGetRoot,upload")
$CurrentTest = "./vcpkg $($args -join ' ')"
Write-Host $CurrentTest
./vcpkg @args
+Throw-IfFailed
Require-FileExists "$installRoot/$Triplet/include/rapidjson/rapidjson.h"
@@ -80,6 +119,7 @@ $args = $commonArgs + @("remove", "rapidjson") $CurrentTest = "./vcpkg $($args -join ' ')"
Write-Host $CurrentTest
./vcpkg @args
+Throw-IfFailed
Require-FileNotExists "$installRoot/$Triplet/include/rapidjson/rapidjson.h"
@@ -90,6 +130,7 @@ Remove-Item -Recurse -Force $installRoot Remove-Item -Recurse -Force $buildtreesRoot
Write-Host $CurrentTest
./vcpkg @args
+Throw-IfFailed
Require-FileExists "$installRoot/$Triplet/include/rapidjson/rapidjson.h"
Require-FileNotExists "$buildtreesRoot/rapidjson/src"
@@ -101,6 +142,7 @@ Remove-Item -Recurse -Force $installRoot Remove-Item -Recurse -Force $buildtreesRoot
Write-Host $CurrentTest
./vcpkg @args
+Throw-IfFailed
Require-FileExists "$installRoot/$Triplet/include/rapidjson/rapidjson.h"
Require-FileNotExists "$buildtreesRoot/rapidjson/src"
@@ -111,11 +153,13 @@ $CurrentTest = "./vcpkg $($args -join ' ')" Remove-Item -Recurse -Force $installRoot -ErrorAction SilentlyContinue
Write-Host $CurrentTest
./vcpkg @args
+Throw-IfFailed
Require-FileNotExists "$installRoot/$Triplet/include/rapidjson/rapidjson.h"
Require-FileNotExists "$buildtreesRoot/rapidjson/src"
Require-FileExists "$TestingRoot/packages.config"
& $(./vcpkg fetch nuget) restore $TestingRoot/packages.config -OutputDirectory "$NuGetRoot2" -Source "$NuGetRoot"
+Throw-IfFailed
Remove-Item -Recurse -Force $NuGetRoot -ErrorAction SilentlyContinue
mkdir $NuGetRoot
@@ -124,6 +168,7 @@ $args = $commonArgs + @("install","rapidjson","tinyxml","--binarycaching","--x-b $CurrentTest = "./vcpkg $($args -join ' ')"
Write-Host $CurrentTest
./vcpkg @args
+Throw-IfFailed
Require-FileExists "$installRoot/$Triplet/include/rapidjson/rapidjson.h"
Require-FileExists "$installRoot/$Triplet/include/tinyxml.h"
Require-FileNotExists "$buildtreesRoot/rapidjson/src"
|
