vcpkg/scripts/azure-pipelines/end-to-end-tests-dir/backcompat-helpers.ps1
ras0219 815396fa4e
[vcpkg] Refactor end-to-end tests (#15081)
* [vcpkg] Refactor end-to-end tests

* [vcpkg] Cherry-pick x-builtin-ports-root from #14999

* [vcpkg] Move create test from unit tests to e2e

Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
2020-12-15 10:26:00 -08:00

27 lines
1.0 KiB
PowerShell

. $PSScriptRoot/../end-to-end-tests-prelude.ps1
# Test that prohibiting backcompat features actually prohibits
$backcompatFeaturePorts = @('vcpkg-uses-test-cmake', 'vcpkg-uses-vcpkg-common-functions')
foreach ($backcompatFeaturePort in $backcompatFeaturePorts) {
$succeedArgs = $commonArgs + @('install',$backcompatFeaturePort,'--no-binarycaching')
$failArgs = $succeedArgs + @('--x-prohibit-backcompat-features')
$CurrentTest = "Should fail: ./vcpkg $($failArgs -join ' ')"
Write-Host $CurrentTest
./vcpkg @failArgs
if ($LastExitCode -ne 0) {
Write-Host "... failed (this is good!)"
} else {
throw $CurrentTest
}
# Install failed when prohibiting backcompat features, so it should succeed if we allow them
$CurrentTest = "Should succeeed: ./vcpkg $($succeedArgs -join ' ')"
Write-Host $CurrentTest
./vcpkg @succeedArgs
if ($LastExitCode -ne 0) {
throw $CurrentTest
} else {
Write-Host "... succeeded."
}
}